Dynamically creating URLS based on user input !
Moderator: General Moderators
Dynamically creating URLS based on user input !
Hi,
I am looking to create pages on the fly or dynamically based on user input. For example if i have http://www.example.com and they visit this and enter 'bob' in a textfield and press submit they create http://www.example.com/bob.html . How would I go about this ? I am guessing I need to create a folder when submit is pressed in my website directory ?
I am looking to create pages on the fly or dynamically based on user input. For example if i have http://www.example.com and they visit this and enter 'bob' in a textfield and press submit they create http://www.example.com/bob.html . How would I go about this ? I am guessing I need to create a folder when submit is pressed in my website directory ?
Everah | Please use
..
i get
Warning: fopen(../public_html/newFile.php ) [function.fopen]: failed to open stream: Permission denied in /public_html/test.php on line 19
Warning: fwrite(): supplied argument is not a valid stream resource in /public_html/test.php on line 20
Warning: fclose(): supplied argument is not a valid stream resource in /public_html/test.php on line 21
How do I solve these problems with my permission
Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
When i try to do the followingCode: Select all
$filename = '.../public_html/newFile.php ';
$mytext = 'text';
fopen($filename, 'w+');
fwrite($filename, $mytext);
fclose($filename);i get
Warning: fopen(../public_html/newFile.php ) [function.fopen]: failed to open stream: Permission denied in /public_html/test.php on line 19
Warning: fwrite(): supplied argument is not a valid stream resource in /public_html/test.php on line 20
Warning: fclose(): supplied argument is not a valid stream resource in /public_html/test.php on line 21
How do I solve these problems with my permission
Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
fopen($filename, 'w+');
the 'w+' should be "w+" (double quotes)
the 'w+' should be "w+" (double quotes)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Please correct me if I'm wrong, but I don't think that he needs to open the directory that much. If owner is apache and group is root (for example...) then 664 or 774 will suffice and that would be a bit more secure.Everah wrote:You are probably going to have to open that directory by assigning it a permission of 666 or even 777. Either way, having writable directories on your server is insanely dangerous if your are not careful of what is going to be written to it.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact: