I tried turning off magic quotes at the beginning of this process--no go there! (I tried it again with the latest code (above), but still the same problem: third item in array of four still showing slashes).
Thanks, though!
Magic Quotes and Strip Slashes: What am I doing wrong?
Moderator: General Moderators
Re: Magic Quotes and Strip Slashes: What am I doing wrong?
Thanks for the posts, but still working on this...
Here is the current code on the add.phtml file:
With this code, I am getting the slashes stripped from the first two and last one of the four items in the array. The third item (pseudo2) still has slashes...
Any advice, anyone?
Many thanks!
Here is the current code on the add.phtml file:
Code: Select all
<?php
function unmagicquotes($string) {
return function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()
? stripslashes($string)
: $string;
}
if (isset($_POST["message1"], $_POST["pseudo1"], $_POST["pseudo2"], $_POST["pseudo3"])) {
$message1 = unmagicquotes($_POST["message1"]);
$pseudo1 = unmagicquotes($_POST["pseudo1"]);
$psuedo2 = unmagicquotes($_POST["pseudo2"]);
$pseudo3 = unmagicquotes($_POST["pseudo3"]);
$filename ="msg.dat";
$file= fopen($filename,'a');
fputs($file, "$message1 - $pseudo1 - $pseudo2 - $pseudo3\n");
fclose($file);
}
?>Any advice, anyone?
Many thanks!
Re: Magic Quotes and Strip Slashes: Problem solved!
Many thanks, tasairis--There was a typo, but now it works. Like a dream! Again, many thanks!