How to get variable out of URL

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
-[Bl@de Runner]-
New php-forum User
New php-forum User
Posts: 9
Joined: Sun Jun 30, 2002 6:45 am

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:


But how do I get in the page where I go to the variable forumIndex from the URL ?


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


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

Post Reply