gma216 Posted August 5, 2007 Share Posted August 5, 2007 I have one form created and posted on 2 seperate servers thats running 2 different versions of php. On this version: http://206studios.com/php.php everything works perfectly fine. but on this version: http://scanwestauto.com/2007/info.php all my variables come up empty. None of the variables get passed into the email, i just get blanks for all fields inputed on the form. Which properties in the PHP should i be looking for to get the second version working like the first? Any help would be much appreciated. Thanks, George Link to comment https://forums.phpfreaks.com/topic/63387-simple-php-contact-form-not-working/ Share on other sites More sharing options...
gma216 Posted August 5, 2007 Author Share Posted August 5, 2007 The following is the script i used for the contact form, its really straight forward, but for some reason just not working properly on that second version (http://scanwestauto.com/2007/info.php): <?php $to ='[email protected]'; $subject ="Scanwest Mailing List Reply"; $content="FIRST NAME: $f_name" . "\r\n" . "LAST NAME: $l_name" $mail_from="$email"; $header="From: $name <$mail_from>"; $send_contact=mail($to,$subject,$content,$header); if($send_contact){ echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='."thankYou.html".'">'; } else { echo "ERROR"; } ?> Link to comment https://forums.phpfreaks.com/topic/63387-simple-php-contact-form-not-working/#findComment-315951 Share on other sites More sharing options...
LiamProductions Posted August 5, 2007 Share Posted August 5, 2007 I found an error <?php $to = '[email protected]'; $subject = "Scanwest Mailing List Reply"; $content = "FIRST NAME: $f_name" . "\r\n" . "LAST NAME: $l_name"; $mail_from = "$email"; $header="From: $name <$mail_from>"; $send_contact = mail($to,$subject,$content,$header); if($send_contact) { echo '<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=\'.\"thankYou.html\".\'\">'; } else { echo "ERROR"; } ?> Try that. The last bit of code may be wrong, Im not sure. but i fixed the missing ; Link to comment https://forums.phpfreaks.com/topic/63387-simple-php-contact-form-not-working/#findComment-316012 Share on other sites More sharing options...
AndyB Posted August 5, 2007 Share Posted August 5, 2007 The problem with 'blank variables' is caused because your script assumes that register_globals is ON. That php setting is a potential security problem and OFF is the default setting in recent releases of php. Your form processing script needs to retrieve the passed variables from the array sent by the form. For example, if your form method is post, then $name = $_POST['name'] will retrieve the variable correctly. Link to comment https://forums.phpfreaks.com/topic/63387-simple-php-contact-form-not-working/#findComment-316013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.