PHP Help

Messages
341
Reaction score
0
Points
0
I am using the PHP command
<?
readfile("filename.txt");
?>

Is there a way i could set up filename.txt so it could be moddified from a .PHP or .HTML file? I have it set to 777 i just need a little help. I would rather NOT use a MySQL database.
 

taekwondokid42

New Member
Messages
268
Reaction score
0
Points
0
I'm not exactly sure what you want to do. If you mean modify the txt through another string of commants from another script, try fopen.

http://www.tizag.com/phpT/files.php for a fairly involved tutorial.

I'd like to point out that mysql is very easy and I'm pretty sure it is much more efficiant (although I'll need someone to confirm that) than this alternate method. It will also take up less space on your cPanel
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
I'm not exactly sure what you want to do. If you mean modify the txt through another string of commants from another script, try fopen.

http://www.tizag.com/phpT/files.php for a fairly involved tutorial.

I'd like to point out that mysql is very easy and I'm pretty sure it is much more efficiant (although I'll need someone to confirm that) than this alternate method. It will also take up less space on your cPanel

Efficient I can vouch for, and it'd also be a hell of a lot easier than trying to modify a file on-the-go (plus it isn't heavy on system resources - KEY for free hosting since high resource usage gets you suspended).

If you're only writing to it once though then go ahead, but if it's something like a forum or anything where it'll get modified frequently, I'd look up some MySQL stuff cause it won't tax your system as much, and it's WAY easier than using files.
 
Top