View Full Version : form data not sending to e-mail

05-04-2006, 06:50 PM
I'm using this to forward my form data to an email based on CAPTCHA entry being correct:

if ( $can_send == 1 ) {
header('Location: http://www.mysite.com/cgi-bin/mail.php');
else {
header( "Location: " .$_SERVER['PHP_SELF'] );

If chars match I want the data sent to the mysite link, if the chars don't match it tells the user to re-enter the CAPTCHA text.

I'm not sure if header is correct, I'm new to PHP so I don't know what else to use. Is this just a redirect or something? Because the data doesn't get sent.

I have about 35 fields on the form so I don't want to add $name, $email, etc as a query string. Is there another way to foward the data?

thanks for any help

05-04-2006, 09:41 PM
er.. dont forward?

function sendmailfunction(){
// Put your mail.php code here

if ($can_send == 1){
header( "Location: " .$_SERVER['PHP_SELF'] );

05-05-2006, 03:15 PM
or in your mail script change any $_POST or $_GET variables to $_REQUEST

05-05-2006, 07:53 PM
I went a different route and got things working. :)