Hello everyone,
This is the first time that I have attempted this and was wanting to know if you could help me. I want to take the following url http://www.onlinecareeroptions.net/profile/username and set a session variable based on the user name and use the index file from the folder /profile.
Thanks for any help you can provide.
Sean
Handleing Session Information From Url
Moderator: General Moderators
-
smcgilvray
- Forum Newbie
- Posts: 3
- Joined: Tue Oct 12, 2010 5:00 pm
Re: Handleing Session Information From Url
Use URL rewriting to turn /profile/username into /profile/index.php?username=username. In your script use $_GET["username"] if it exists. If someone goes to just /profile then it will not.
When you say "session variable" I think you mean a regular variable, not a session variable.
When you say "session variable" I think you mean a regular variable, not a session variable.
-
jankidudel
- Forum Commoner
- Posts: 91
- Joined: Sat Oct 16, 2010 4:30 pm
- Location: Lithuania, Vilnius
Re: Handleing Session Information From Url
$_SESSION['profile'] = $_GET['username'] ????
-
smcgilvray
- Forum Newbie
- Posts: 3
- Joined: Tue Oct 12, 2010 5:00 pm
Re: Handleing Session Information From Url
Thank you tasairis for you replay how would the .htaccess rewrite rule look like.
Thanks again
Sean
Thanks again
Sean
-
smcgilvray
- Forum Newbie
- Posts: 3
- Joined: Tue Oct 12, 2010 5:00 pm
Re: Handleing Session Information From Url
Thanks everyone got it figured out.
Sean
Sean