Jump to content

variable and include function HELP really complex.


Minimeallolla

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.

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?

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.