I know this has been asked tons of times. But my submit button isn’t working on an Email script I have.
<?php
if (isset($_REQUEST['email']))
{
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail("necro@gophobia.com", $subject,
$message, "From:" . $email);
echo "Thank you for using our mail form";
}
else
{
echo "<form method='post' action='http://cogameservers.com/home/contact'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>
Thanks for any help =]
Edit
When I say the submit button doesnt work. I mean it does nothing at all.
Check your HTML source code. It is completely messed up:
<html>tag<head>contains many lines of code that should be placed in<body>instead (such as<div id="loginmodal" class="reveal-modal">)The browser does it best to overcome errors, but sometimes it gets lost when there are too many serious errors.
There are other errors, check what the validator outputs. Fix your HTML code, check that the validator is happy, then try again submitting your form.
The correct syntax for conditional comments is explained here. In your case it should be:
But your code currently is:
Anyway, since there already is an opening
<html>tag earlier, it will cause an error: there can be only one<html>tag in the page.