RE: [PHP-WIN] writing form data into text file
| From: | R'twick Niceorgaw | Date: | Sat, 03 Aug 2002 01:19:28 +0000 |
| Subject: | RE: [PHP-WIN] writing form data into text file | ||
| References: | 1 | Groups: | php.windows php.windows |
| Request: | Send a blank email to php-windows+get-15098@lists.php.net to get a copy of this message | ||
Replace this line
fputs($fp, "$name");
With
fputs($fp, $_POST["name"]);
Or, set register_globals On in your php.ini file.
R'twick
-----Original Message-----
From: Andreas Esser [mailto:andreas@neo-planet.de]
Sent: Friday, August 02, 2002 9:14 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] writing form data into text file
hello,
i want to write form data into a txt file by using the fwrite()
function... but i cant write the form data into the txt file, only
strings that were typed in by myself directly at the php script..
here´s the script that i am using:
<html>
<head>
<title>Sign</title>
</head>
<body bgcolor="#FFFFFF">
<form name =gb method=post action=zeigen.php>
Your Name: <input type=text name=name size=24><br>
<input type=submit>
</form>
<?php
$file = "guestbook.txt";
$fp = fopen("$file","a+");
fputs($fp, "$name");
fclose($fp);
?>
</body>
</html>
the function readfile() works perfectly, when i write something into the
txt file by myself...but when the form data should written into the txt
file it doesn´t work...
can someone tell me why???
i am using the following configuration:
apache webserver 1.3.26 (for windows)
php 4.2.1
windows 2000 (not with NTFS, just FAT)
thx for your help
andreas
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php