Page 1 of 1

Handleing Session Information From Url

Posted: Tue Oct 12, 2010 5:10 pm
by smcgilvray
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

Re: Handleing Session Information From Url

Posted: Tue Oct 12, 2010 5:31 pm
by requinix
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.

Re: Handleing Session Information From Url

Posted: Sun Oct 17, 2010 2:02 pm
by jankidudel
$_SESSION['profile'] = $_GET['username'] ????

Re: Handleing Session Information From Url

Posted: Mon Oct 18, 2010 12:31 pm
by smcgilvray
Thank you tasairis for you replay how would the .htaccess rewrite rule look like.

Thanks again

Sean

Re: Handleing Session Information From Url

Posted: Mon Oct 18, 2010 3:31 pm
by smcgilvray
Thanks everyone got it figured out.

Sean