no value

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
speedy33417
Forum Contributor
Posts: 128
Joined: Sun Jul 23, 2006 1:14 pm

no value

Post by speedy33417 »

I'm trying to set $album to "main" if there's no GET value coming in.

Code: Select all

$album = $_GET['album'];
if ($album = "") {
	$album = "main";
}
I'm guessing ($album = "") is where I'm wrong.

Thanks.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Code: Select all

if(empty($_GET['album']))
   $album = "main";
else
   $album = $_GET['album'];
User avatar
speedy33417
Forum Contributor
Posts: 128
Joined: Sun Jul 23, 2006 1:14 pm

Post by speedy33417 »

Thanks. :wink:
Post Reply