Having sorted out the hosting issue with Go Daddy I am having problems with my contact form. I have created one using the below tutorial:
https://www.youtube.com/watch?v=5a_zy_utoFM
https://www.youtube.com/watch?v=6q7ndD0rt2s
My code is:
I have saved this as contact_us.php as suggested.
I have changed the link from the home page from contact_us.htm to contact_us.php so it opens the correct page, but it's blank.
When I view source code it is empty?
On the Go Daddy File Manager the file is 6.18KB, so there should at least be code there?
If I use contact_us.htm, when I submit I get:
File not found 404 etc and then in the address bar: <?php%20echo%20htmlspecialchars($_SERVER[%27PHP_SELF%27]);?>
https://www.youtube.com/watch?v=5a_zy_utoFM
https://www.youtube.com/watch?v=6q7ndD0rt2s
My code is:
PHP:
<?php
$to = '[email protected]';
$subject = 'This came from XYZ';
$name = $_POST['name'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$message = <<<EMAIL
Hi! My name is $name.
$message
From $name
My email is $email
EMAIL;
$header = '$email';
if($_POST)
{
mail($to, $subject, $message, $header);
$feedback = 'Thanks for the email';
}
?>
<p><span class="error">* required field.</span></p>
<form action="?" method="post">
<label for="name">Name:</label>
<input type="text" name="name" id="name" />
<span class="error">*</span>
<br><br>
<label for="email">Email:</label>
<input type="text" name="email" id="email" />
<span class="error">*</span>
<br><br>
<label for="comment">Comment:</label>
<textarea id="comment" name="comment" rows="9" cols="42"></textarea>
<br><br>
<input id="submit" input type="submit" name="submit" value="Submit">
<br><br>
</form>
<p id="feedback"><?php echo $feedback; ?></p>
I have saved this as contact_us.php as suggested.
I have changed the link from the home page from contact_us.htm to contact_us.php so it opens the correct page, but it's blank.
When I view source code it is empty?
On the Go Daddy File Manager the file is 6.18KB, so there should at least be code there?
If I use contact_us.htm, when I submit I get:
File not found 404 etc and then in the address bar: <?php%20echo%20htmlspecialchars($_SERVER[%27PHP_SELF%27]);?>
Last edited: