Page 1 of 1

Retrieving url using session variable

Posted: Wed Apr 15, 2009 8:00 am
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....

Re: Retrieving url using session variable

Posted: Wed Apr 15, 2009 8:53 am
by php_east
have you looked at the manual for pathinfo ?