View Full Version : File Writing
pyro.699
10-04-2005, 12:03 AM
Hello, im making a members area, and i need to know if this will work
if i use
$filename = '.htpasswd'
file_put_contents($filename, "pyro.699:password") or die ('could not write to file);
will that erace all the information already in the file? or will it add it underneth of the previous text...
read this.
http://www.w3schools.com/php/php_functions2.asp
it will help you understand how to use PHp to open and append files.
pyro.699
10-04-2005, 12:13 AM
i understand php fine, i was a verry fine tuned question... will it erace all of the files current context?
Andreas
10-04-2005, 12:29 AM
Not tested, but according to the documentation it will overwrite it - if you don't set FILE_APPEND.
pyro.699
10-04-2005, 06:35 PM
ahhh, leave it to kirby to get the job done ^^
so, that means i go
$filename = '.htpasswd'
FILE_APPEND($filename, "pyro.699:password") or die ('could not write to file);
Marco van Herwaarden
10-04-2005, 08:00 PM
No!
file_put_contents($filename, "pyro.699:password", FILE_APPEND)
pyro.699
10-04-2005, 09:43 PM
ah, thanks marco
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.