Hi All,
I use a form and store the data in a text file but when using (") quotation mark in the input field, php writes it to text file as a backslash().
How can i save the data properly? Give me a small example, please.
Özkan Özipekliler
stripslashes($var);
You can turn off magic quotes, and it will never bother you again 😉
use a database backend instead of text files.
if you insist on text files, turn off magic quotes or eregi_replace("\"",""",$blah)
<?php $filea1 = "a.txt"; $linea1 = "$abc"; stripslashes($linea1); $file = fopen ("$filea1", "a+"); $stringa = "$linea1"; fputs ($file, $stringa); fclose ($file); echo ("OK"); ?>
You must set $linea1 to the stripslashes.
$linea1 = stripslashes($linea1);