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 Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.