Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

How to get variable out of URL

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

How to get variable out of URL

Postby -[Bl@de Runner]- » Sun Aug 04, 2002 2:06 am

Hi guys,

I go to a certain page in my site, with this URL and I pass a variable forumIndex with it:

http://localhost/showThread.php?s=&forumIndex=%201

But how do I get in the page where I go to the variable forumIndex from the URL ?
-[Bl@de Runner]-
New php-forum User
New php-forum User
 
Posts: 9
Joined: Sun Jun 30, 2002 6:45 am

Postby Jay » Sun Aug 04, 2002 3:43 am

I don't really understand your question, but you mean either one of two things:

You either want to generate a page with PHP and use the variable in your URL somewhere. You can use either the variable name ($formIndex), $HTTP_GET_VARS['forumIndex'] or $_GET['forumIndex'] depending on your PHP installation

or

You want the browser to automatically scroll down the page to a designated location. For this you would put an anchor at the location (<a name='yourAnchor'>), and add #yourAnchor to the end of the url (after all the variables too, the # sign is the delimiter).
Jay
 


Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.