Jump to content

variable and include function HELP really complex.


Minimeallolla
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old.

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.

 Share

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