By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,871 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,871 IT Pros & Developers. It's quick & easy.

Accessing URL parameters

P: n/a
How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,

Aaron
Dec 31 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Mon, 31 Dec 2007 18:24:28 +0100, Aaron Gray <an********@gmail.com>
wrote:
How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,
Do you want to examine the URL string?
http://www.php.net/parse_url
http://www.php.net/parse_str

Or in the current request, it's offcourse in the $_GET array.
--
Rik Wasmus
Dec 31 '07 #2

P: n/a
"Rik Wasmus" <lu************@hotmail.comwrote in message
news:op***************@metallium.lan...
On Mon, 31 Dec 2007 18:24:28 +0100, Aaron Gray <an********@gmail.com>
wrote:
>How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,

Do you want to examine the URL string?
http://www.php.net/parse_url
http://www.php.net/parse_str

Or in the current request, it's offcourse in the $_GET array.
parse_url() looke helpful, but I wanted the current pages URL parameters, is
the $_GET ?

Aaron

Dec 31 '07 #3

P: n/a
On Mon, 31 Dec 2007 18:45:07 +0100, Aaron Gray <an********@gmail.com
wrote:
"Rik Wasmus" <lu************@hotmail.comwrote in message
news:op***************@metallium.lan...
>On Mon, 31 Dec 2007 18:24:28 +0100, Aaron Gray <an********@gmail.com>
wrote:
>>How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,

Do you want to examine the URL string?
http://www.php.net/parse_url
http://www.php.net/parse_str

Or in the current request, it's offcourse in the $_GET array.

parse_url() looke helpful, but I wanted the current pages URL
parameters, is
the $_GET ?
The parameters from the query string indeed.

http://www.example.com/path/to/file.ext?foo=foz&bar=baz

...will result in a $_GET array while running file.ext:
array(
'foo' ='foz',
'bar' ='baz')

If you want other information as well, search the $_SERVER array for your
needs.
--
Rik Wasmus
Dec 31 '07 #4

P: n/a
Aaron Gray wrote:
How do I access URL parameters, and ideally as an associative array ?
$_GET

Cheers,
--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Proudly running Debian Linux with 2.6.22-3-amd64 kernel, KDE 3.5.8, and PHP
5.2.4-2 generating this signature.
Uptime: 19:00:06 up 39 days, 5:15, 4 users, load average: 0.62, 0.51,
0.56

Dec 31 '07 #5

P: n/a
"Rik Wasmus" <lu************@hotmail.comwrote in message
news:op***************@metallium.lan...
On Mon, 31 Dec 2007 18:45:07 +0100, Aaron Gray <an********@gmail.com>
wrote:
"Rik Wasmus" <lu************@hotmail.comwrote in message
news:op***************@metallium.lan...
>On Mon, 31 Dec 2007 18:24:28 +0100, Aaron Gray <an********@gmail.com>
wrote:
>>How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,

Do you want to examine the URL string?
http://www.php.net/parse_url
http://www.php.net/parse_str

Or in the current request, it's offcourse in the $_GET array.

parse_url() looke helpful, but I wanted the current pages URL parameters,
is
the $_GET ?
The parameters from the query string indeed.

http://www.example.com/path/to/file.ext?foo=foz&bar=baz

...will result in a $_GET array while running file.ext:
array(
'foo' ='foz',
'bar' ='baz')

If you want other information as well, search the $_SERVER array for your
needs.

Thanks,

Aaron
Dec 31 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.