-
PHP to save data to a text file
Hey guys ... I need to know how to save varibales from flash to a text file ... Using a PHP script
Is this possible ...
Could someone maybe write a small script to do that ... like maybe just save one var to a text file ... and can figure out the rest ...
thanks guys,
-s
-
Hi,
Yes it is possible.
After you have received your vars go on like this:
PHP Code:
$entry=$_POST["myvar"]
$file="myfile.txt";
$open=fopen($file,"a");
if($open){
fwrite($open,$entry);
fclose($open);
}
You have to determine a file, in this case 'myfile.txt'. Then open your file with 'fopen'. The 'a' in fopen is very important. It means that your data will be added at the end of your textfile and it creates a file if the file doesnt´t exist.
After you have written the data (in this case the var '$entry') in your file, close the current file with 'fclose'.
Last edited by andreaskrenmair; 09-18-2003 at 04:43 AM.
-
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
|