[thelist] having problems with php redirect form

Anthony Baratta Anthony at Baratta.com
Fri Sep 20 10:41:01 CDT 2002

At 04:16 AM 9/20/2002, rudy wrote:
> ><form action="/redirect.php">
> >
> ><?php
>tim, i don't know php, but if you are passing the goto form field and
>expecting it to be in the query string, i think you have to explicitly use
>GET as form method, the browser is likely sending it as POST by default

I see the problem now.

Tim, you can't use $_SERVER["QUERY_STRING"]. This will give you the "whole"
query-string including it's key word. That's why you are getting the goto=/URL.

What you need to use is:

$_GET = for query strings and form gets
$_POST = for form posts

P.S. Rudy, GET is the default for a form if no method is given.
Anthony Baratta
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."

More information about the thelist mailing list