Minimeallolla Posted November 17, 2010 Share Posted November 17, 2010 Ok it's abit complicated so i'll try to explain as best as I can. Upon registration a file is created with your username that was registered and also a file for your profile named after your username so it would be /profiles/usernamesprofilehere.php. I put a code into the profile that is: include ("/home/giacjrdi/public_html/mysite/profiles/profileinfo/$username.info.php"); echo "<center><b><br /> $user's Profile <br /></b></center>"; $username is calling the cookie's username while $user is calling the account's username. eg if I try to view "bob"'s profile but logged in as "fred" since the include function is under $username which is cookies, it will retrieve "fred"'s information and post it on "bob"'s profile. The only sollution i can think of would be to store a username variable in the url and use it for the include function. Quote Link to comment https://forums.phpfreaks.com/topic/218921-variable-and-include-function-help-really-complex/ Share on other sites More sharing options...
trq Posted November 17, 2010 Share Posted November 17, 2010 Lets step back a bit. Why are you creating new pages for each user in the first place? PHP is generally used to make dynamic websites which keep there data within a database, you could use this 'dynamic' technique to serv all your user profiles from a single profile page. Do you think that every time you post a new topic on this board a new page is created? Quote Link to comment https://forums.phpfreaks.com/topic/218921-variable-and-include-function-help-really-complex/#findComment-1135350 Share on other sites More sharing options...
Minimeallolla Posted November 17, 2010 Author Share Posted November 17, 2010 no but a new page is created for every user? which is what im trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/218921-variable-and-include-function-help-really-complex/#findComment-1135352 Share on other sites More sharing options...
trq Posted November 17, 2010 Share Posted November 17, 2010 No new pages need to be created. This is the basic principle of dynamic web pages. Check out this thread: http://www.phpfreaks.com/forums/php-coding-help/now-that-i-know-what-to-ask-here-goes/msg446570 Quote Link to comment https://forums.phpfreaks.com/topic/218921-variable-and-include-function-help-really-complex/#findComment-1135358 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.