Dynadot — .com Registration $8.99

How can I have multiple stripslashes in mail script?

Spaceship Spaceship
Watch

sedokill

Account Closed
Impact
0
ok i have a php mail script which i am adding extra parts to for more info however it used to have 1 stripslashes bit for the msg but i need 3 other bits of info from the user so i made another stripslashes and that works but then the 3rd doesnt for some reason. see code below.

PHP:
<?php

// headers for the email listed below

$headers .= "From: $name <$email>\n";  // your email client will show the person's email address like normal
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; // sets the mime type
$recipient = "[email protected]"; // enter YOUR email address here
$subject = "Contact From website"; // this is the subject of the email

$msg = wordwrap( $msg, 1024 );

// WHEN I ADD ANOTHER STRIPSLASHES BELOW IT DONT WORK
mail($recipient, $subject, stripslashes($msg), stripslashes($clickbank), $headers); // the mail() function sends the message to you

//Once the data is entered, redirect the user to give them visual confirmation
   header("location: thanks.html");
?>

Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
The mail() funciton takes three or four parameters, not FIVE as you have it. The format is like this:

mail(recipient, subject, message, add'l headers);

I am not sure what you are trying to do with the "stripslashes($clickbank)" portion.

-Bob
 
0
•••
ok basically i know little php and got this mail script i made a few extra forms for extra information but they didnt work untill i put striplashes then a variable in the php script and called the form, name="variable" in the html page.

Please tell me how i can add a few striplashes above without it wrecking the script can i start a new mail() ....?

Thanks
 
0
•••
When you want to add more info to your message, you would want to append it to the variable that you're using for your message rather than try to add it on to the mail function itself. So you would most likely want to append the $clickbank variable on to the $msg variable.

For example, you could do something like:

$msg .= "\n\nClickbank: $clickbank";
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back