Silly question, but is it possible to make a variable a case?
I've seen sites do this where the URL is
http://www.siteurl.com/viewprofile.php? ... ergoeshere]
and displays their profile accordingly.
How is this done?
Another thing, is it possible to just assign a new session variable that stores the requested profile's user ID within an existing session to do this? And then have it access the database and retrieve the profile?
Any ideas? I'm designing a members-only profile site and want to design it in the most efficient way possible.
Thanks in advance for any comments,
Aimee
Cases using variables
Moderator: General Moderators
-
superaimee
- Forum Newbie
- Posts: 1
- Joined: Fri Dec 24, 2004 8:03 pm
- Location: Columbia, SC
Usually the way you would do this is:
Then you can echo your fields and place them where you want on the page by using <?=$r['username']?>
Code: Select all
<?php
$sql = "SELECT username, email_address FROM users where id = ". $_GET['uid'];
$result = mysql_query($sql);
$r = mysql_fetch_array($result);
?>