<form method='post' action='mailform.php'> <fieldset> <label for='message'><b>Reflection:<b></label><br/><br/> <p>Tell us what you thought of the Workshop, did you enjoy the tasks?, Could we have done anything different?</p> <textarea name='message' rows='15' cols='80'> </textarea><br/> <input type='submit' VALUE='Send' size='5' /> </fieldset> </form>
and here is the mailform.php:
<?php
if (isset($_REQUEST['message']))
//if "feedback" is filled out, send feedback
{
//send email
$message = $_REQUEST['message'] ;
mail('email', 'Feedback From Workshop 1', $message);
echo "<p>Thanks for sending your feedback, hopefully it will help us improve the experience for other students.</p>";
echo "<p>You are now being redirected to the homepage</p>";
}
else
//if "email" is not filled out, display error message
{
echo "No information entered";
}
?>
when I send an empty form it still emails it, what am I doing wrong? also is there just a simple javascript code I could use that would just flash up red text in the message box?
This post has been edited by Addio569: 05 April 2012 - 07:43 AM

New Topic/Question
Reply




MultiQuote





|