Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

need help writing to a txt file...

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

need help writing to a txt file...

Postby Mike_Willis » Sat Jul 05, 2003 8:03 am

Ok, I am having trouble making php write and save to a text file on my website. I have a php scrip activated by a flash button, which is the following:

<?
$totext ="testing to text file";
$file = "index.txt";
$fp = fopen( $file,"w+");
fwrite($fp, $totext, 100);
fclose ( $fp );
?>

the file index.txt has permissions 777, and all files are in the same folder. but when i execute the script the text file stays blank. could someone please tell me what i am doing wrong? i took the basic variables from a tutorial script for creating a flash counter, and i am not sure what everything does, such as the "100". If anyone can tell me how to write to text files, then you help would very much be appreciated :)

Thanks,
Mike
Mike_Willis
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Jul 05, 2003 7:53 am

Postby Mike_Willis » Sat Jul 05, 2003 8:13 am

ahhh!, got it... dont worry... its working now. just missed a ";" in my script :)
Mike_Willis
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Jul 05, 2003 7:53 am


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher and 6 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.