Retrieving url using session variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rrn
Forum Commoner
Posts: 46
Joined: Wed Apr 15, 2009 7:54 am

Retrieving url using session variable

Post by rrn »

hi all
i am new to this forum and this is my first post

please help me..

my website is in php,html,sql

i have wriiten a code shown below

Code: Select all

session_start();
$pagename=pathinfo($_SERVER["PHP_SELF"]);
$pagename=$pagename["basename"];
$_SESSION['page']=$pagename;
if i am in the page http://www.test.com/index.php

$_SESSION['page'] has the value 'index.php'

ie if i am on http://www.test.com/abc.php $_SESSION['page]] has the value abc.php

that code is working fine.

but my problem is that
if the url is http://www.test.com/abc.php?catid=56

the rest part of abc.php ie '?catid=56' is not retrieved..

how can i get that also??
give me a solution, please....
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: Retrieving url using session variable

Post by php_east »

have you looked at the manual for pathinfo ?
Post Reply