Jump to content

Dynamically creating URLS based on user input !


lunny

Recommended Posts

Hi,

 

I am looking to create pages on the fly or dynamically based on user input. For example if i have www.example.com and they visit this and enter 'bob' in a textfield and press submit they create 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 ?

Link to comment
Share on other sites

Only if you want to give yourself a massive headache in administering such a file structure....

 

Have a look at search engine frindly urls - what your doing does need to be search engine friendly BUT I think it would help you A LOT if you have just one page creating all your pages.

 

Using apahce's modrewrite will let you direct every request to one page - you can then grab info from the url and use it to constuct your page...

Link to comment
Share on other sites

ok ill explain why..

 

Im currently doing a project for school in which we want to track email snoopers i.e other people reading your mail. For each users that wished to create a honeypot email we want to create a new URL which has never been visited before so that when the snooper visits we can get his details etc

Link to comment
Share on other sites

well I can see that working for one case, but the way it works is many users can subsribe to our 'service' and we would have traps set up at any time. And the user would be able to check the status of his trap. So I would like a different link for every user, so we can determine the snooper for that person not the URL

Link to comment
Share on other sites

When i try to do the following

 

$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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.