----- Original Message -----
From: "whoisquilty"
Robert - Your solutions all insert the name of the submit button rather than
pass the form
data.
I've found that I have access to the ini file. But there is no entry for
magic quotes. Is this
the best way to fix the problem? What do I need to add to do this?
Jeremy
------------------------------------
Hello Jeremy,
I tested with the code below. I don't have magic quotes
enabled but this should work for you.
Just put the small block of code below, into your script before any $_POST
variables are used.
if(get_magic_quotes_gpc())
{
foreach($_POST as $key => $value)
{
$_POST[$key] = stripslashes($value);
}
}
If the above does not work then try this instead...
foreach($_POST as $key => $value)
{
$_POST[$key] = stripslashes($value);
}
Below again is the script that I used to test.
<html>
<head>
</head>
<body>
<?php
if(!isset($_POST['submit']))
{
?>
<form action="<?php echo($_SERVER['PHP_SELF']) ?>" method="post">
<input type="text" name="item1" value='"double"'><br>
<input type="text" name="item2" value="'single'"><br>
<input type="text" name="item3" value="/backslash/"><br>
<input type="text" name="item4" value="\slash\"><br>
<input type="text" name="item5" value="\\escape\\"><br>
<input type="submit" name="submit" value="Test">
</form>
<?php
}
if(isset($_POST['submit']))
{
foreach($_POST as $key => $value)
{
$_POST[$key] = stripslashes($value);
echo('$_POST[' . $key . '] = [' . $_POST[$key] . ']<br>' . "\n");
}
}
?>
</body>
</html>