I am creating a form and storing the values in file. Could anyone please tell me how to write a code in php for creating a filename based on the user name as in the form.
Thanks
Ramya
Filename like the user name
Moderator: General Moderators
Re: Filename like the user name
Do you mean creating a new file or altering an existing file?
-
ramya4myself
- Forum Newbie
- Posts: 7
- Joined: Sat Nov 07, 2009 2:46 pm
Re: Filename like the user name
I want to create new file for every new user who fills the form but the file name should be in the user's name which the user enters.
-
ramya4myself
- Forum Newbie
- Posts: 7
- Joined: Sat Nov 07, 2009 2:46 pm
Re: Filename like the user name
Thanks.
It worked by using the code
But I want the filename in a particular directory like PHP/Peter.txt. This is not happening even though I set the permissions of the file and the directory. It displays an error "fopen cannot open directory: Is a directory /PHP/Peter.txt ". Could anyone please help me with this.
It worked by using the code
Code: Select all
$file=$name;