Jump to content

Deprecated magic_quotes_gpc


Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.