Getting values from the query string

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Imaginatorium
New php-forum User
New php-forum User
Posts: 4
Joined: Tue Jan 21, 2003 7:06 am
Location: Sano, Japan
Contact:

Getting values from the query string

Postby Imaginatorium » Tue Jan 21, 2003 7:29 am

I can't find this in the manual - and the search function at php.net seems to be broken today.

I have a page that will be referenced with an argument; e.g.

http://imaginatorium.org/shop/?src=google

I want to leave a cookie with this value; but if a cookie of the same name already exists, leave it there. (So I get the earliest referrer.)

Problem: normally the variable $src immediately gives me the value from the query string, but unfortunately if I've already set a cookie, then $src has the cookie value, and I can't get at the query string value. How can I do so?

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Postby Joan Garnet » Tue Jan 21, 2003 1:49 pm

Please, post a piece of code.

Imaginatorium
New php-forum User
New php-forum User
Posts: 4
Joined: Tue Jan 21, 2003 7:06 am
Location: Sano, Japan
Contact:

Postby Imaginatorium » Wed Jan 22, 2003 6:20 am

Sorry! The answer was $_GET["src"].

The search function on the manual site was broken, so as a beginner I was stuck. All figured out now.


Return to “PHP coding => General”

Who is online

Users browsing this forum: Google [Bot] and 1 guest