alandean Posted January 20, 2011 Share Posted January 20, 2011 Hi, php newbie here, web developer newbie too! Some time ago I did a website which included a course registration form which someone else created for me in php. This worked fine and I amended the original to work on another website. I am currently updating this second website and the php has stopped working, and I am no longer in contact with the original developer of the code. The form is at: http://www.bisntechnologies.com/register.htm, and the php is: <?php /* ------- Stuff You Can Change --------- */ $recipient = '[email protected]'; $redirect = 'confirmation.php'; /* -------------------------------------- */ $name = $HTTP_POST_VARS['name']; $company = $HTTP_POST_VARS['company']; $position = $HTTP_POST_VARS['position']; $telephone = $HTTP_POST_VARS['telephone']; $email = $HTTP_POST_VARS['email']; $interest = $HTTP_POST_VARS['interest']; $clientip = $_SERVER['REMOTE_ADDR']; $msg = "Name: $name\nCompany: $company\nPosition: $position\nTelephone: $telephone\nE-mail: $email\nInterest: $interest\n\nIP Address: $clientip"; $replymsg = "<html><body style=\"font-family: Trebuchet MS; font-size: 13px\"><p>Dear $name,</p><p>Thank you for registering.</p><p><a href=\"http://www.bisntechnologies.com\"><img border=0 src=\"http://www.bisntechnologies.com/images/NewLogo.jpg\" alt=\"BiSN Technologies Ltd\"></a></p></body></html>"; if (mail($email,'Registration',$replymsg,"MIME-Version: 1.0\r\nContent-type: text/html;charset=iso-8859-1\r\nFrom: [email protected]")) { mail($recipient,'Registration Confirmation',$msg,"From: $email"); include($redirect); } else { echo "<h4>\"$email\" is an invalid e-mail address. Please click the browser's Back button.</h4>"; } ?> Putting in valid information gives the error: "" is an invalid e-mail address. Please click the browser's Back button." which it didn't used to do. I expect it is a very simple mistake but I cannot trace it. Any help to pinpoint the problem greatly appreciated. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/225039-php-registration-form-not-working/ Share on other sites More sharing options...
TOA Posted January 20, 2011 Share Posted January 20, 2011 Your host may have updated its version of php in which case the HTTP_POST_VARS[] reference wont work. The first thing I would try is changing all those to $_POST[] Link to comment https://forums.phpfreaks.com/topic/225039-php-registration-form-not-working/#findComment-1162301 Share on other sites More sharing options...
parino_esquilado Posted January 20, 2011 Share Posted January 20, 2011 next time use [/ php] tags please. Link to comment https://forums.phpfreaks.com/topic/225039-php-registration-form-not-working/#findComment-1162311 Share on other sites More sharing options...
alandean Posted January 20, 2011 Author Share Posted January 20, 2011 DA, Thank you for the very prompt reply. Have changed as you advised with a global search and replace. The form appears to be working correctly now. Thank you so much. PE - Not sure what you mean but will check whwn I have more time. Link to comment https://forums.phpfreaks.com/topic/225039-php-registration-form-not-working/#findComment-1162313 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.