You can also look at environment variable $QUERY_STRING. For example,

         if ($HTTP_SERVER_VARS['QUERY_STRING'] == 'login') {
                 ...do log in procedure

If register_globals is on, all you need is

         if ($QUERY_STRING == 'login')

If you might be passing other parameters in the URL, and want to ignore 
case, you could use something like:

         if (eregi('login', $QUERY_STRING)) {

This would match

         www.blah.com?login
         www.blah.com?LogIn
         www.blah.com?login&user=herman_hollerith

but it would also match

         www.blah.com?sloginthemud
         www.blah.com?login0

So, a little regular expression twiddling might be in order.

For more info, see:

http://www.php.net/manual/en/language.variables.predefined.php
http://www.php.net/manual/en/ref.regex.php
http://www.php.net/manual/en/ref.pcre.php


         -steve



At 02:43 PM 4/16/01 , Plutarck wrote:
>Add an "=" on the end of your url. Viola.
>
>
>--
>Plutarck
>Should be working on something...
>...but forgot what it was.
>
>
>""Jeroen Geusebroek"" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi Guys,
> >
> > I have a question about the way PHP handles var/strings.
> >
> > Let's say i have this URL: http://foo.bar.com/?login.
> > And in my script i have this code:
> >
> > if($login) { echo "blab"; } or
> > if(isset($login)) { echo "blab"; }
> >
> > It always returns FALSE. I think that is because the string
> > is empty. Shouldn't PHP, even if a var is empty, put it in
> > his var-list?
> >
> > Is there another way to do what i want?
> >
> > Thanks,
> >
> > Jeroen Geusebroek
> >


+------------------------------------------------------------------------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                                     (530)754-9127 |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+---------------------- Gort, Klaatu barada nikto! ----------------------+


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to