problem i cant see... :-(
Posted: Fri Jun 20, 2003 1:30 am
I'm having a problem with this, I want to make it so that people will fill out a form on feedback.php (which is included into my main template) which then gets posted to feedback&status=post which takes those fields and mails them to me.
Not too sure what I am doing wrong, any advice would be good, THANKS!!
Not too sure what I am doing wrong, any advice would be good, THANKS!!
Code: Select all
<?php
<?
$date = date("H\:i\:s d\/m\/Y");
$name = $POST_[name];
$email = $POST_[email];
$email = $POST_[comments];
$message = "$name <$email> submitted the following on $date. $comments" ;
?>
<?
$status ;
if ($GET_['status'] === post) {
if each(!$http_POST_VARS[name]){ ///trying to get rid of empty fields
echo "You haven't filled out all of the fields"
}
else {
mail("chris@southernhosting.net", "Feedback from VenturerWeb", $message,
"From: VenturerWeb\r\n"
."Reply-To: chris@southernhosting.net\r\n"
."X-Mailer: PHP/" . phpversion());
echo "<span class"bodytext">Thanks for your comments, we'll read them as soon as possible. If you need to contact the editor further please contact him at his <a href="index.php?page=profile&person=chris" class="link">profile.</a></span>";
}
}
else {
echo <<<END
<form name="feedback" method="post" action="index.php?page=feedback&status=post">
<p class="bodytext">Please let us know what you think of our website! Any thoughts,
ideas, problems just type them in the box and let us know, we will get on to
it as soon as possible! </p>
<p>
<label>
<input name="name" type="text" value="Name" class="textfield">
</label>
</p>
<p>
<label>
<input name="address" type="text" value="e-mail address" class="textfield">
</label>
<label> </label>
</p>
<p>
<label>
<textarea name="comments" class="textfield">Your comments</textarea>
</label>
</p>
<p>
<label>
<input type="hidden" name="date" value="{$date}">
</label>
<label>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="reset" value="Reset">
<br>
<span class="note">please click submit only once</span></label>
<label> </label>
</p>
<p>
<label> </label>
</p>
</form>
END;
?>
?>