poleman Posted July 18, 2007 Share Posted July 18, 2007 Hi, where am I going wrong with this form.... Here's the form code: <form method="POST" action="contact.php"> <span lang="en-gb"><font size="2" face="Verdana">Name: </font></span><input type="text" name="T1" size="20"><br> <br> <span lang="en-gb"><font size="2" face="Verdana">Email: </font> </span><input type="text" name="T1" size="30"><span lang="en-gb"> <font size="2" face="Verdana">Phone: </font> <input type="text" name="T2" size="20"><br> </span></p> <span lang="en-gb"><font size="2" face="Verdana">Query: </font></span><textarea rows="15" name="S1" cols="40"></textarea></p> <p align="justify"><span lang="en-gb"> </span><input type="submit" value="Submit" name="B2"></p> </form> and here's the php code: <?PHP error_reporting(E_ERROR | E_WARNING | E_PARSE); ini_set('track_errors', true); function DoStripSlashes($FieldValue) { if ( get_magic_quotes_gpc() ) { if (is_array($FieldValue) ) { return array_map('DoStripSlashes', $FieldValue); } else { return stripslashes($FieldValue); } } else { return $FieldValue; } } #---------- # FilterCChars: function FilterCChars($TheString) { return preg_replace('/[\x00-\x1F]/', '', $TheString); } if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ClientIP = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ClientIP = $_SERVER['REMOTE_ADDR']; } $FTGT1 = DoStripSlashes( $_REQUEST['T1'] ); $FTGT2 = DoStripSlashes( $_REQUEST['T2'] ); $FTGS1 = DoStripSlashes( $_REQUEST['S1'] ); # Redirect user to the error page if ($ValidationFailed === true) { header("Location: http://www.jsay.co.uk/ITS/contactfailed"); exit; } # Email to Form Owner $emailSubject = FilterCChars("Enquiry from ITS Website"); $emailBody = "Name : $FTGT1\n" . "Email : $FTGT2\n" . "Phone : $FTGS1\n" . ""; $emailTo = "ITS <enquiry@itstravel.co.uk>"; $emailFrom = FilterCChars("$FTGT2"); $emailHeader = "From: $emailFrom\n" . "MIME-Version: 1.0\n" . "Content-type: text/plain; charset=\"ISO-8859-1\"\n" . "Content-transfer-encoding: 8bit\n"; mail($emailTo, $emailSubject, $emailBody, $emailHeader); # Redirect user to success page header("Location: http://www.jsay.co.uk/ITS/thankyou"); exit; ?> Hope you can help!! thanks!! ??? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 18, 2007 Share Posted July 18, 2007 It would help if you told us what the problem was. Quote Link to comment Share on other sites More sharing options...
poleman Posted July 18, 2007 Author Share Posted July 18, 2007 well, the problem is that when entering data into the fields, the page returns to the way it was but without the data that was filled in (instead of going to the success or error page) and the data from the form is not sent to the email address specified. Hope you can help.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.