Jump to content


Photo

no value


  • Please log in to reply
2 replies to this topic

#1 speedy33417

speedy33417
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 28 September 2006 - 02:05 PM

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

$album = $_GET['album']; 
if ($album = "") { 
        $album = "main"; 
}


I'm guessing ($album = "") is where I'm wrong.

Thanks.

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 28 September 2006 - 02:18 PM

Correct...

Try:

if ($album == ""){

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 28 September 2006 - 02:19 PM

You should do something like this:
$album = (isset($_GET['album']) && !empty($_GET['album']) ? $_GET['album'] : 'main');





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users