Stripslashes & PHP - HELP!

I’ve done a mail form, in flash MX, which then passes the varibles to PHP

I’m ending up with slashes in my text.

I’ve tried the stripslashes command with no luck.
Still have the slashes.

here’s my code:

<?
$person = stripslashes($person);
$subject = stripslashes($subject);
$name = stripslashes($name);
$message = stripslashes($message);

$user ="$person";

  $msg = "$name

";
   $msg .= "$message

";

  mail($user, $subject, $msg, "From: $email
Reply-To: $email
");

?>

This is not working, what’s wrong?

Please help, I have no idea what to do.

thanks!

Try this:


<?

$monkey = "Test\ something \\";

$monkey = str_replace("\\", " ", $monkey);

print $monkey

?>

Thanks for the reply…

but I’m confused…

first, i got a parse error, trying to use the code provided…

second, I don’t understand how to apply this to my current code.

Can you explain?..I’m very new to PHP.

thanks again

oops the code didn’t come out right…

try this


$person = str_replace("\\\\", "", $person);
$subject = str_replace("\\\\", "", $subject);
$name = str_replace("\\\\", "", $name);
$message = str_replace("\\\\", "", $message);

thanks again,
but didn’t work…still have slashes :*(

does this go at the front of the code?..that’s where I put it…but same result.


<?

$person_=_str_replace("\\",_"",_$person);
$subject_=_str_replace("\\",_"",_$subject);
$name_=_str_replace("\\",_"",_$name);
$message_=_str_replace("\\",_"",_$message);

$user ="$person";

  $msg = "$name

";
   $msg .= "$message

";

  mail($user, $subject, $msg, "From: $email
Reply-To: $email
");

?>

whats not working? the e-mail isn’t being sent? or you just get slashes? The code that I gave you works fine for me…

where are those _ coming from?

Juppa, thanks for the reply,

ok…here goes nothing.

The email is being sent just fine, it’s still got slashes in it.

Here’s my code in Flash MX assigned to my “send button”

on (release) {
if (name eq “” or subject eq “” or message eq “” or email eq “”) {
gotoAndStop(2);
} else if (!email.length || email.indexOf(“@”) == -1 || email.indexOf(“.”) == -1) {
gotoAndStop(6);
} else if (_root.comboBox.getSelectedItem().data eq “choose”) {
gotoAndStop(7);
} else {
person = _root.comboBox.getSelectedItem().data;
loadVariablesNum(“form.php”, “0”, “POST”);
gotoAndStop(5);
name = “”;
subject = “”;
message = “”;
email = “”;
}
}

Here’s the original contents of form.php which works…just has slashes showing up in the email.



<?

$user ="$person";

  $msg = "$name

";
   $msg .= "$message

";

  mail($user, $subject, $msg, "From: $email
Reply-To: $email
");

?>


NO errors or anything, just doesn’t seem to do anything…I still get slashes with any word that has quotes or whatever…

all 4 lines gotta be like this one
$person_=str_replace("","",$person);
except that you forgot the 2nd \ , to escape the 1st one :wink:
$person
=str_replace("\","",_$person);