lunny Posted March 13, 2007 Share Posted March 13, 2007 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 https://forums.phpfreaks.com/topic/42518-dynamically-creating-urls-based-on-user-input/ Share on other sites More sharing options...
Lumio Posted March 13, 2007 Share Posted March 13, 2007 what for? Link to comment https://forums.phpfreaks.com/topic/42518-dynamically-creating-urls-based-on-user-input/#findComment-206298 Share on other sites More sharing options...
ToonMariner Posted March 13, 2007 Share Posted March 13, 2007 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 https://forums.phpfreaks.com/topic/42518-dynamically-creating-urls-based-on-user-input/#findComment-206302 Share on other sites More sharing options...
gargoylemusic Posted March 13, 2007 Share Posted March 13, 2007 Yeah, this seems like a perfect use of Apache's ModRewrite functionality (that is, control this on a server-level instead of PHP-level) Link to comment https://forums.phpfreaks.com/topic/42518-dynamically-creating-urls-based-on-user-input/#findComment-206304 Share on other sites More sharing options...
lunny Posted March 13, 2007 Author Share Posted March 13, 2007 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 https://forums.phpfreaks.com/topic/42518-dynamically-creating-urls-based-on-user-input/#findComment-206308 Share on other sites More sharing options...
legohead6 Posted March 13, 2007 Share Posted March 13, 2007 why dont you just make it count how many times someone goes there thats not on his username or ip address or whatever?.... Link to comment https://forums.phpfreaks.com/topic/42518-dynamically-creating-urls-based-on-user-input/#findComment-206312 Share on other sites More sharing options...
lunny Posted March 13, 2007 Author Share Posted March 13, 2007 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 https://forums.phpfreaks.com/topic/42518-dynamically-creating-urls-based-on-user-input/#findComment-206320 Share on other sites More sharing options...
lunny Posted March 13, 2007 Author Share Posted March 13, 2007 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 https://forums.phpfreaks.com/topic/42518-dynamically-creating-urls-based-on-user-input/#findComment-206371 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.