Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2001051

RE: [PHP-DB] Newbie: IF statement From: Taylor, Stewart (Stewart.Taylor <email protected>)
Date: 05/14/01

You should be using '==' compare not '=' assignment
Plus you can use the isset function to determine whether the $page variable
has been set

e.g. if (!isset($Page)) $Page="homepage";

-Stewart

-----Original Message-----
From: Dan Eskildsen [mailto:dan <email protected>]
Sent: 14 May 2001 11:24
To: php-db <email protected>
Subject: [PHP-DB] Newbie: IF statement

MAJOR NEWBIE ALERT!

I can't believe this! I can't even work out an IF statement!

My page contains a search string (eg: page.php3?Page=products )

If the URL does not contain a search string (ie page.php3) then I want to
assign the Page variable to 'homepage".

I have tried these if statements, but without luck:

 if ($Page='') { $Page="homepage" }

 if ($Page="") { $Page="homepage" }

 if ($Page=null) { $Page="homepage" }

I tried the manual at
http://www.php.net/manual/en/control-structures.php#control-structures.if
but without luck.

Any help?!?!

==================================
Regards from Denmark, Europe
Please cc your reply to dan <email protected>
==================================
I haven't lost my mind, I've got it backed up on TAPE somewhere.......

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>