The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> retrieving url using session
rrn
post Apr 15 2009, 06:54 AM
Post #1


Novice
**

Group: Members
Posts: 21
Joined: 15-April 09
Member No.: 8,330



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Apr 15 2009, 07:30 AM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



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!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
rrn
post Apr 15 2009, 07:45 AM
Post #3


Novice
**

Group: Members
Posts: 21
Joined: 15-April 09
Member No.: 8,330



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.........
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Apr 15 2009, 11:09 AM
Post #4


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



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.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
rrn
post Apr 16 2009, 01:48 AM
Post #5


Novice
**

Group: Members
Posts: 21
Joined: 15-April 09
Member No.: 8,330



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...

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 07:22 PM