likethegoddess Posted July 26, 2008 Share Posted July 26, 2008 I'm working with a third-party contact form, trying to expand it for my own use. I found out that the use of "magic_quotes_gpc " is deprecated for PHP6. I've seached this forum in addition to a general web search for substitutions for this portion. Any ideas for updating the following: <? $mailto = 'info@sample.com' ; $subject = "Contact form message" ; $formurl = "http://www.sample.com/contact/index.html" ; $errorurl = "http://www.sample.com/contact/error.html" ; $thankyouurl = "http://www.sample.com/contact/thankyou.html" ; // -------------------- END OF CONFIGURABLE SECTION --------------- $name = $_POST['name'] ; $email = $_POST['email'] ; $subject = $_POST['subject'] ; $comments = $_POST['comments'] ; $spam=$_POST['spam'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (empty($name) || empty($email) || empty($subject) || empty($comments) || $spam!="56728") { header( "Location: $errorurl" ); exit ; } $name = strtok( $name, "\r\n" ); $email = strtok( $email, "\r\n" ); $subject = strtok( $subject, "\r\n" ); if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper ="---------- Crazyleafdesign.com message ----------\n\n" . "\nSent by : " . $name . "\nEmail : " . $email . "\nSubject : " . $subject . "\n\n\nMessage : " . $comments; mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php 2.04" ); header( "Location: $thankyouurl" ); exit ; ?> Thanks, Diana 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.