http://www.vbulletin.com/forum/showt...threadid=29241
you can post the reply here if you want
Printable View
http://www.vbulletin.com/forum/showt...threadid=29241
you can post the reply here if you want
Well, what language? :rolleyes:
vBulletin Community Forum > General > PHP coding > txt files
php ;)
PHP Code:<?
// variables
$filepath = "file.txt";
echo "<html>
<head>
<title></title></head>
<body>";
if ($submit){
$fileread = fopen("file.txt", "w");
fwrite($fileread,$ID);
fclose($fileread);
echo "File Saved";
}else {
echo "<center><form action=\"$php_self\" method=\"POST\">";
$filebody = implode("",file($filepath));
echo "<textarea type=text name=\"ID\" size=50 rows=20 cols=50>$filebody</textarea>";
echo "<input type=submit name=submit value=submit></form>";
echo"</body></html>";
}
?>
thanks, my only problem is that when it you enter a ' it saves it as a \'
ok let me play around with it. I think you might need the magic_quotes in but not sure.
I can't get it to do that. I do know what you are talking about. are you on your server or an isp? if yours what is it, Apache?
forget that last post.. lol
add this (bold)
$fileread = fopen("file.txt", "w");
$ID = stripslashes($ID);
fwrite($fileread,$ID);
thanks
hey dim, I was fooling around with it and came up with this.