Re: Re: Am i crazy?

From: Date: Mon, 05 Nov 2001 03:46:05 +0000
Subject: Re: Re: Am i crazy?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-73469@lists.php.net to get a copy of this message
Just a note: if ($name='admin') vs. if ('admin'=$name) ... One gives you voodoo code, the other gives a syntax error. Pick your language. if ('admin' == $name) works every time... <SoapBox> Hopefully $MPATH contains the beginning of an ABSOLUTE URI :) error_reporting (E_ALL); // PHP4 error_reporting (255); // PHP3 (magically works for PHP4 too) </SoapBox> John At 11/5/2001 02:57 AM -0500, Jim Conner wrote: >At 18:59 11.04.2001 +0100, oliver walkhoff wrote: >> > Did I forget everything in a few months? >> > if ($name='admin') { >> > header("Location: $MYPATH/admin.php"); >> > } >> >>try if ($name =='admin') { >> >>('==' instead of '=', otherwise you are assigning 'admin' to >>$name) ! >> >>oliver > >You are correct to correct him in setting his equality straight, but he >will continue to have a problem. It should be "working" the way he is >writing the condition simply because either way, he'd have a true statement >(supposing $name is really eq to "admin". Therefore, he has more than one >problem here. However, I know nothing about the header() function. >- Jim -- /* SteeleSoft Consulting John Steele - Systems Analyst/Programmer * We also walk dogs... Dynamic Web Design PHP/MySQL/Linux/Hosting * www.steelesoftconsulting.com jsteele@steelesoftconsulting.com */

« previous php.general (#73469) next »