AstrosMF Posted March 8, 2007 Share Posted March 8, 2007 <?php $sub = $_GET['sub']; if ($sub == "") $sub == "home"; in this instance when the user types in an address it of course is not going to have the sub attached so I am trying to make it assign a "sub" if there is none inputed in the address bar... but this isn't working... any ideas? Michael Link to comment https://forums.phpfreaks.com/topic/41818-solved-_get-question/ Share on other sites More sharing options...
artacus Posted March 8, 2007 Share Posted March 8, 2007 Give this a go. $sub = ($_GET['sub']) ? $_GET['sub'] : 'home'; Link to comment https://forums.phpfreaks.com/topic/41818-solved-_get-question/#findComment-202800 Share on other sites More sharing options...
artacus Posted March 8, 2007 Share Posted March 8, 2007 $sub == "home" is a comparison operator where you want an assignment operator > $sub = 'home' Link to comment https://forums.phpfreaks.com/topic/41818-solved-_get-question/#findComment-202803 Share on other sites More sharing options...
AstrosMF Posted March 8, 2007 Author Share Posted March 8, 2007 amazing... you rock! thanks so much Link to comment https://forums.phpfreaks.com/topic/41818-solved-_get-question/#findComment-202804 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.