Re: [PHP] Why won`t this work??
bard wrote: > Plus, this is PHP, not javascript. Variables look like this, "$UN" > not this, "UN". $UN is a variable. UN might be a constant, if it is defined as one. If not, its just a string. Wagner -- Three may keep a secret, if two of them are dead. -- 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]
Re: [PHP] Why won`t this work??
On Sun, 21 Jan 2001, Alexander Wagner wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > > Can anyone tell me before I rip my hair out, why this won`t work?? > > > > if (!UN) > > { > > printf("alert('Please enter a User > > Name.');self.history.back();"); > > } > > > > TIA > > Ade > > An undefined constant will return true. You have to explicitly define > it as 0 to make this work. > I guess this is becauese PHP interpretes it as a string, and all > strings but '' are true. It has to, because it doesn't know it is a > constant. > > Wagner > Plus, this is PHP, not javascript. Variables look like this, "$UN" not this, "UN". Brad -- 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]
Re: [PHP] Why won`t this work??
Try this... alert('Please enter a User Name.'); self.history.back(); Cheers, Brad On Sun, 21 Jan 2001 [EMAIL PROTECTED] wrote: > Hi, > > Can anyone tell me before I rip my hair out, why this won`t work?? > > if (!UN) > { > printf("alert('Please enter a User > Name.');self.history.back();"); > } > > TIA > Ade > > -- 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]
[PHP] Why won`t this work??
Hi, Can anyone tell me before I rip my hair out, why this won`t work?? if (!UN) { printf("alert('Please enter a User Name.');self.history.back();"); } TIA Ade -- 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]