arandam Posted November 23, 2010 Share Posted November 23, 2010 i have a php application with user registration. i have to show each user , and user related pages as a sub-folder i.e for a user 'cooluser', if he logs-in, it should show www.mysite.com/cooluser/index.php my problem is, i cannot create a directory for each user, because, in each user there are 30 pages, showing the user profile information I tried friendly urls, but, it needs to have sub -folder. the partial content comes from mysql database. is there any solution/ advise? Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/ Share on other sites More sharing options...
BlueSkyIS Posted November 23, 2010 Share Posted November 23, 2010 use mod_rewrite to send all users to the same file (not directory). display content based on the user's id. Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138258 Share on other sites More sharing options...
arandam Posted November 23, 2010 Author Share Posted November 23, 2010 I am new to php, Can you explain a bit? Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138264 Share on other sites More sharing options...
trq Posted November 23, 2010 Share Posted November 23, 2010 This thread should get you a pretty good start. Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138268 Share on other sites More sharing options...
arandam Posted November 23, 2010 Author Share Posted November 23, 2010 yes, thats clear. I tried RewriteEngine On Options +FollowSymlinks RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?id=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?id=$1 but, not able to make any progress. Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138278 Share on other sites More sharing options...
trq Posted November 23, 2010 Share Posted November 23, 2010 but, not able to make any progress. What exactly does that mean? You need to be allot more specific. Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138279 Share on other sites More sharing options...
nilansanjaya Posted November 23, 2010 Share Posted November 23, 2010 can u explain whats goin on ? and why friendly url's not working ? i guess its easily done using friendly url's ( mod_rewrite ) and bit of logic Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138311 Share on other sites More sharing options...
arandam Posted November 23, 2010 Author Share Posted November 23, 2010 i tried few examples, but, unable to get the solution to the situation, i explained above Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138321 Share on other sites More sharing options...
trq Posted November 23, 2010 Share Posted November 23, 2010 i explained above Obviously not well enough for me to help. Oh well.... Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138323 Share on other sites More sharing options...
arandam Posted November 23, 2010 Author Share Posted November 23, 2010 ok, i will try explaining again. of course, its at the best interest of getting solution . 1.I have user registration system. 2.the user profile is stored in database. 3. when the user(username=cooluser) logs-in, at www.mysite.com/login.php, he should get a url www.mysite.com/cooluser/index.php or www.mysite.com/cooluser/ 4.the user profile has 30 pages of info, all are php files 5.all these user profile pages need to be displayed under www.mysite.com/cooluser/ i.e. www.mysite.com/cooluser/gallery.php, www.mysite.com/cooluser/printeddocs.php, www.mysite.com/cooluser/focus.php etc 6.if i try url rewrite, its giving me first page www.mysite.com/cooluser and the other pages are displayed as www.mysite.com/gallery.php and so on. but, i want them to be displayed under www.mysite.com/cooluser/gallery.php and so on. I did my best to explain, if any pieces are not understood, pl. drop note. thanks Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138333 Share on other sites More sharing options...
arandam Posted November 23, 2010 Author Share Posted November 23, 2010 ok, i will try explaining again. of course, its at the best interest of getting solution . 1.I have user registration system. 2.the user profile is stored in database. 3. when the user(username=cooluser) logs-in, at www.mysite.com/login.php, he should get a url www.mysite.com/cooluser/index.php or www.mysite.com/cooluser/ 4.the user profile has 30 pages of info, all are php files 5.all these user profile pages need to be displayed under www.mysite.com/cooluser/ i.e. www.mysite.com/cooluser/gallery.php, www.mysite.com/cooluser/printeddocs.php, www.mysite.com/cooluser/focus.php etc 6.if i try url rewrite, its giving me first page www.mysite.com/cooluser and the other pages are displayed as www.mysite.com/gallery.php and so on. but, i want them to be displayed under www.mysite.com/cooluser/gallery.php and so on. I did my best to explain, if any pieces are not understood, pl. drop note. thanks edited : another problem is...i have to create a php file 'cooluser' without extention .php, that mean, for each user i have to create such files. Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138346 Share on other sites More sharing options...
arandam Posted November 23, 2010 Author Share Posted November 23, 2010 main point is if the user enters the url, www.mysite/cooluser, automatically, it should get the profile data if the user is browsing around the site and clicks his profile link, which is www.mysite/user.php?id=1, it should go to www.mysite/cooluser Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138361 Share on other sites More sharing options...
trq Posted November 23, 2010 Share Posted November 23, 2010 4.the user profile has 30 pages of info, all are php files 5.all these user profile pages need to be displayed under www.mysite.com/cooluser/ i.e. www.mysite.com/cooluser/gallery.php, www.mysite.com/cooluser/printeddocs.php, www.mysite.com/cooluser/focus.php etc Do these files actually exist? If so, where? 6.if i try url rewrite, its giving me first page www.mysite.com/cooluser and the other pages are displayed as www.mysite.com/gallery.php and so on. but, i want them to be displayed under www.mysite.com/cooluser/gallery.php and so on. That makes zero sense and completely contradicts itself. What exactly is the problem? edited : another problem is...i have to create a php file 'cooluser' without extention .php, that mean, for each user i have to create such files. Did you even look at the link I posted? Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138362 Share on other sites More sharing options...
arandam Posted November 23, 2010 Author Share Posted November 23, 2010 >>>>5.all these user profile pages need to be displayed under www.mysite.com/cooluser/ i.e. www.mysite.com/cooluser/gallery.php, www.mysite.com/cooluser/printeddocs.php, www.mysite.com/cooluser/focus.php etc >>>>Do these files actually exist? If so, where? ------yes these files exist in the same directory under www.mysite.com >>>>6.if i try url rewrite, its giving me first page www.mysite.com/cooluser and the other pages are displayed as www.mysite.com/gallery.php and so on. but, i want them to be displayed under www.mysite.com/cooluser/gallery.php and so on. >>>>hat makes zero sense and completely contradicts itself. What exactly is the problem? ----the problem is cooluser is not a directory. but, just a php file, where extention is hidden. how can we show the profile related pages under coouser/ like www.mysite.com/cooluser/gallery.php >>>>Did you even look at the link I posted? -----I looked at the post, i tried other possibilities and wrote you the result. I also tried what you wrote in example, but, its not giving the needed result Quote Link to comment https://forums.phpfreaks.com/topic/219538-minisite-profile-site/#findComment-1138388 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.