Shaun wrote:
Quote:
Hi,
How can I check if a form has been submitted, I have seen a demo that uses
the following:
if(isset($HTTP_POST_VARS))
But I understand that $HTTP_POST_VARS is depricated...
Thanks for your help |
Try this:
<?php if ($_POST){ if
(mail("YOU (AT) YOU (DOT) COM",$_POST['subject'],stripslashes($_POST['body']),"From:
".$_POST['email']."\r\n")){ ?>
<p>Your message is now winging its way to me at supersonic speed!</p>
<h2>You said:</h2>
<blockquote>“<?php echo "$body" ?>”.</blockquote>
<p>I will be in touch with you as quickly as possible.</p>
<?php }else{ ?>
<p>Message Failed, the gremlins are playing up!</p>
<?php } }else{ ?>
<form action="<?PHP echo $_SERVER['PHP_SELF']; ?>" method="post"
name="mailform" id="mailform">
<fieldset title="Send Me Some Mail">
<legend>Send Me Some Mail</legend>
<label for="subject">Subject:</label>
<select name="subject" id="subject">
<option selected="selected">Enquiry</option>
<option>Suggestion</option>
<option>Praise</option>
<option>Design Work</option>
</select>
<label for="email">Email:</label>
<input name="email" type="text" id="email" value="Your email here" />
<label for="body">Message:</label>
<textarea name="body" cols="30" rows="12" id="body">Message you wish to
send</textarea>
<input type="submit" name="Submit" value="Send" id="Submit" />
</fieldset>
</form>
<?php } ?>
If it's sent you should get:
Your message is now winging its way to me at supersonic speed!
you said:
"blah blah blah"
I will be in touch with you as quickly as possible.
If it failed:
Message Failed, the gremlins are playing up!
Hope this helps
Gordon M
http://gordonmac.com