Help - Search - Members - Calendar
Full Version: retrieving url using session
HTMLHelp Forums > Programming > Server-side Scripting
rrn
hi all..

i am new to this forum and this is my post...

please help me to solve my problem


my website is in php

am using the below shown code for getting index.php of www.test.com/index.php
CODE
session_start();
$pagename=pathinfo($_SERVER["PHP_SELF"]);
$pagename=$pagename["basename"];
$_SESSION['page']=$pagename;


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

it is working fine..
but my problem is that.. if the url is www.test.com/index.php?catid=60
the rest part after index.php ie '?catid=60' is not retrieved..

how can i do that???
please help..
i will be very grateful..
thank you
Brian Chandler
Make a file in your password-protected (or similar) private area, containing:

CODE

<?php
phpinfo();


Running this page prints all the info available to your program.

I think what you want is

$_SERVER["REDIRECT_QUERY_STRING"]

but please learn to find things as above!
rrn
QUOTE(Brian Chandler @ Apr 15 2009, 07:30 AM) *

Make a file in your password-protected (or similar) private area, containing:

CODE

<?php
phpinfo();


Running this page prints all the info available to your program.

I think what you want is

$_SERVER["REDIRECT_QUERY_STRING"]

but please learn to find things as above!


sorry, i didn't understand.........can u please explain ???

i will be really grateful......

thank you.........
Brian Chandler
QUOTE(rrn @ Apr 15 2009, 09:45 PM) *

QUOTE(Brian Chandler @ Apr 15 2009, 07:30 AM) *

Make a file in your password-protected (or similar) private area, containing:

CODE

<?php
phpinfo();


Running this page prints all the info available to your program.

I think what you want is

$_SERVER["REDIRECT_QUERY_STRING"]

but please learn to find things as above!


sorry, i didn't understand.........can u please explain ???



Make a file in your password-protected (or similar) private area, containing:

** Means: Create a file with a text editor. Write the following in it:

CODE

<?php
phpinfo();


Upload this file to your server. If possible, use a private area not publicly accessible. Call the file himitsu.php (for example).

Access this file by typing http://***YOUR DOMAIN***/himitsu.php?fruit=orange in the address bar of your browser.

Look in the page that you get for "fruit=orange". This will show you a $_SERVER[] variable that contains the *query string*, which is what you are looking for.

rrn
QUOTE(Brian Chandler @ Apr 15 2009, 11:09 AM) *

QUOTE(rrn @ Apr 15 2009, 09:45 PM) *

QUOTE(Brian Chandler @ Apr 15 2009, 07:30 AM) *

Make a file in your password-protected (or similar) private area, containing:

CODE

<?php
phpinfo();


Running this page prints all the info available to your program.

I think what you want is

$_SERVER["REDIRECT_QUERY_STRING"]

but please learn to find things as above!


sorry, i didn't understand.........can u please explain ???



Make a file in your password-protected (or similar) private area, containing:

** Means: Create a file with a text editor. Write the following in it:

CODE

<?php
phpinfo();


Upload this file to your server. If possible, use a private area not publicly accessible. Call the file himitsu.php (for example).

Access this file by typing http://***YOUR DOMAIN***/himitsu.php?fruit=orange in the address bar of your browser.

Look in the page that you get for "fruit=orange". This will show you a $_SERVER[] variable that contains the *query string*, which is what you are looking for.


sorry , i tried it but didnt work. anyway thanks a lot for your help...

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.