|
-
Sep 30th, 2001, 03:14 PM
#1
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Sep 30th, 2001, 03:20 PM
#2
Member
Well, what language?
-
Sep 30th, 2001, 03:26 PM
#3
Thread Starter
Frenzied Member
vBulletin Community Forum > General > PHP coding > txt files
php
NXSupport - Your one-stop source for computer help
-
Sep 30th, 2001, 08:17 PM
#4
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>";
}
?>
-
Sep 30th, 2001, 08:23 PM
#5
Thread Starter
Frenzied Member
thanks, my only problem is that when it you enter a ' it saves it as a \'
NXSupport - Your one-stop source for computer help
-
Sep 30th, 2001, 08:29 PM
#6
ok let me play around with it. I think you might need the magic_quotes in but not sure.
-
Sep 30th, 2001, 08:41 PM
#7
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?
-
Sep 30th, 2001, 08:44 PM
#8
forget that last post.. lol
add this (bold)
$fileread = fopen("file.txt", "w");
$ID = stripslashes($ID);
fwrite($fileread,$ID);
-
Sep 30th, 2001, 08:56 PM
#9
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Sep 30th, 2001, 09:50 PM
#10
hey dim, I was fooling around with it and came up with this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|