darubillah Posted May 17, 2010 Share Posted May 17, 2010 hi, i want a little help, i am making a site in which i also added a referral system now I want to create an IF ELSE condition for eg <a href="index.php?id=<? echo $_GET["id"]; ?>">HOME</a> now if some one refers to my page it will get id from QUERY STRING but I want that if someone not refers him, or he come from googling or direct then the value of QUERY STRING id will be " 0" ,,, id=0 can anyone tell me how to do this thankyou best Regards Shayan Link to comment https://forums.phpfreaks.com/topic/202020-if-query-string-id-is-empty-then-id0-if-else-condition/ Share on other sites More sharing options...
darubillah Posted May 17, 2010 Author Share Posted May 17, 2010 I made this and it working <a href="index.php?id=<? if($_GET["id"]==null) { echo "0"; } else { echo $_GET["id"]; } ?>">HOME</a> Link to comment https://forums.phpfreaks.com/topic/202020-if-query-string-id-is-empty-then-id0-if-else-condition/#findComment-1059384 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.