NYCPHP Meetup

NYPHP.org

[nycphp-talk] I can't code today to save my life! :

Hans Zaunere hans at nyphp.org
Sat Jan 4 17:09:32 EST 2003


--- Phil Powell <soazine at erols.com> wrote:
> Content-Transfer-Encoding: quoted-printable

I guess my quoted-printable parser is broken - sorry folks :)

> I have $REQUEST_URI that will take two values:
> 
> "/event/login.php"
> 
> and
> 
> "/event/register.php"
> 
> What I need to do is so simple it's brainless!!! I need to look into
> $REQUEST_URI and find if it contains "register.php".  I tried this and
> it completely failed, the results were wrong every time:
> 
> if (strpos($REQUEST_URI, "register.php") !== 0) { // you're in
> login.php }
> 
> I don't know why I can't get this other than weekend stupidity, can
> someone help?

Two possible problems:

-- The if() statement isn't doing the proper comparison.

if( strpos($REQUEST_URI,'register.php') === FALSE ) {
   echo 'Then by default we assume to have login.php!';
}

-- Check that $REQUEST_URI does in fact contain what you expect with a
trigger_error() or echo call.



=====
Hans Zaunere
President, New York PHP
http://nyphp.org
hans at nyphp.org



More information about the talk mailing list