php11980 Posted May 14, 2014 Share Posted May 14, 2014 Kind of inherited this project and could use some assistance. The script below worked on a windows server running IIS and php 4. Upgraded server and PHP to version 5.5.3 and the script no longer works. Keep getting an error of undefined variable for the following lines of code: $name=strtoupper($name); $email=strtoupper($email); $sub=trim($subject); $problem=trim($problem); Complete script: <?php $name=strtoupper($name); $email=strtoupper($email); $sub=trim($subject); $problem=trim($problem); if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email)) { echo "That is not a valid email address. Please return to the" ." previous page and try again."; exit; } $toaddress = "helpdesk@maharam.com"; // thelpdesk mail box $subject = $sub; $mailcontent = "Your name:<i> ".strtolower($name)."</i>\n" ."Your email address is: <i>".strtolower($email)."</i>\n" ."Subject: <i>".$sub."</i>\n" ."Helpdesk Request: <i>".$problem."</i>\n"; $emailcontent = $problem; mail($toaddress, $sub, $emailcontent, "From: $name<$email>"); ?> Any help is appreciated. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted May 14, 2014 Share Posted May 14, 2014 i recommend that you read all of the relevant php version migration sections in the php documentation so that you are aware of what has changed in php over time that will affect your code - http://us3.php.net/manual/en/appendices.php Quote Link to comment Share on other sites More sharing options...
Barand Posted May 14, 2014 Share Posted May 14, 2014 As Mac_gyver suggested, but go back about 10 years in the documentation as your code looks as though it was relying on register_globals being ON and that was deprecated about a decade ago. 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.