Hi--
I am hoping that someone can help me with this problem I am having with Magic Quotes and Strip Slashes...
I am using a simple PHP script (which I got from someone else--I know nothing about PHP!) that allows the user to input a small amount of text that goes to a msg.dat file and then subsequently scrolls out across the page. (example at http://webyarns.com/MythWatch/Guestbook.html)
The problem is, whenever a " is used, or a ', the program adds a / into the text read-out. (I can see this on the msg.dat page, and on the scrolling text on the site above).
I am already using magic quotes (in my www folder), and I have tried turning them On and OFF, but no help. I am hearing that the answer is stripslashes, but even after finding examples of this on the web, I do not know what the proper code is, or where to put it.
The initial text is sent from a Flash page (at bottom).
Here is the code from the add.phtml file:
<?php
$filename ="msg.dat";
$file= fopen($filename,'a');
fputs($file, "$message1 - $pseudo1 - $pseudo2 - $pseudo3\n");
fclose($file);
?>
And here is the code from the get_random.phtml file (this randomly selects the message to display):
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$filename = 'msg.dat';
$messages = file($filename);
$message = $messages[array_rand($messages)];
echo 'msg=' . $message;
?>
And here is the code from the Flash page from which the initial message is sent:
on (release) {
if (mc.message !== "Name..." && mc2.pseudo !== "Archetypal moment..." && mc3.pseudo !== "Place..." && mc4.pseudo !== "Date...") {
message1 = root.input.mc.message;
pseudo1 = root.input.mc2.pseudo;
pseudo2 = root.input.mc3.pseudo;
pseudo3 = root.input.mc4.pseudo;
loadVariables("add.phtml", "", "POST");
with (root.guestbook) {
msg = root.input.mc.message+" - "+root.input.mc2.pseudo+" - "+root.input.mc3.pseudo+" - "+_root.input.mc4.pseudo+" ";
gotoAndPlay(2);
}
gotoAndPlay("valid");
} else {
gotoAndPlay("invalid");
}
}
I am at a loss. Is it possible someone could offer me some advice on this?
Many, many thanks for any help!