Desmond wrote:
Wha I am doing is using a html form for sending an Email the input box
may have a name
Paul O'Brien so the PHP line $name = $_POST["Name"]; end up in the
email as
Paul O\Brien replacing the the (') to (\) if i use stripslashes()
there are no slashes to strip
Here's a sample program I just wrote:
<?
if (isset($_POST['submit'])) {
echo '$_POST array<pre>';
print_r($_POST);
echo '</pre>';
$name = stripslashes($_POST['name']);
echo 'You entered the name of <span style="font-weight:bold">' . $name
.. "</span><br>\n";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test form</title>
</head>
<body>
<form method="post" action="<? echo $_SERVER['PHP_SELF']?>">
Name: <input type="text" style="width:50%" name="name"><br>
<input type="submit" name="submit" value="Send Data">
</form>
</body>
</html>
And here's the output:
$_POST array
Array
(
[name] => O\'Brian
[submit] => Send Data
)
You entered the name of O'Brian
Notice how the single quote is escaped in the input data, so when I
assign it to a variable I used stripslashes() to unescape it.
Compare this code to what you have (since you didn't post it) and see
if it differs. Then run this code to see what it produces.
Ken