Jump to content

create file


rpjd

Recommended Posts

I'm using a php $_POST variable as the name of a file that I want to create.  fopen() , according to my understanding open the file if it exists or creates it if it doesn't. 

$Ref = $_POST['Ref'];

I using each reference element of $Ref as the name of a file in a certain directory.  So if $Ref[$i] exists as a file name in a certain directory, append to the file, if it doesn't create the file in that directory and write to it.  Do I use the file path of the file within fopen()?  fopen(./References/$Ref,a) or  fopen(./References/$Ref,w)? 

Link to comment
https://forums.phpfreaks.com/topic/232281-create-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.