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 ?

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

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

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

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

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.