Alecdude Posted December 10, 2008 Share Posted December 10, 2008 <?php if ($_SESSION['badge1']=1) { echo "<a href=cheez.php>You do own The Badge uv Awfsum Cheezburger. Click here to access the secret page.</a>"; } else { echo "You do not own The Badge uv Awfsum Cheezburger. <a href=badge1.php>Buy it!</a>"; }?> Even if you don't have the badge (badge1=0,) it says you have it. Please help, -Alec Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/ Share on other sites More sharing options...
dezkit Posted December 10, 2008 Share Posted December 10, 2008 change <?php if ($_SESSION['badge1']=1) { to <?php if ($_SESSION['badge1'] == 1) { P.S. Stop creating new threads, I see you post a new thread on here at least every hour, post all your problems in one f-cking thread. It's really annoying. Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712014 Share on other sites More sharing options...
Alecdude Posted December 10, 2008 Author Share Posted December 10, 2008 change <?php if ($_SESSION['badge1']=1) { to <?php if ($_SESSION['badge1'] == 1) { P.S. Stop creating new threads, I see you post a new thread on here at least every hour, post all your problems in one f-cking thread. It's really annoying. It still outputs as you have it. And to the PS, ok, sorry abut that. Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712017 Share on other sites More sharing options...
dezkit Posted December 10, 2008 Share Posted December 10, 2008 Post the code that you are using currently. Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712022 Share on other sites More sharing options...
Alecdude Posted December 10, 2008 Author Share Posted December 10, 2008 <?php if ($_SESSION['badge1'] == 1) { echo "<a href=cheez.php>You do own The Badge uv Awfsum Cheezburger. Click here to access the secret page.</a>"; } else { echo "You do not own The Badge uv Awfsum Cheezburger. <a href=badge1.php>Buy it!</a>"; }?> Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712026 Share on other sites More sharing options...
dezkit Posted December 10, 2008 Share Posted December 10, 2008 I guess the session isn't registered than. Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712030 Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 <?php if ($_SESSION['badge1'] == 1) { echo "<a href=cheez.php>You do own The Badge uv Awfsum Cheezburger. Click here to access the secret page.</a>"; } else { echo "You do not own The Badge uv Awfsum Cheezburger. <a href=badge1.php>Buy it!</a>"; }?> You dont have session_start at the top of the script. Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712032 Share on other sites More sharing options...
Alecdude Posted December 10, 2008 Author Share Posted December 10, 2008 Oh wait - nevermind, it works now. The thing before set it to 1. I have one more question. How do you display all the users who have a specific value, such as if a user has badge1=1, it displays them, along with the others with that. I'm pretty sure it's a MySQL syntax, but I'm not fully sure. Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712035 Share on other sites More sharing options...
dezkit Posted December 10, 2008 Share Posted December 10, 2008 SELECT * FROM example WHERE badge1='1' Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712039 Share on other sites More sharing options...
Alecdude Posted December 10, 2008 Author Share Posted December 10, 2008 Nevermind. Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712042 Share on other sites More sharing options...
dezkit Posted December 10, 2008 Share Posted December 10, 2008 Did you rename the "example" in the query to your table name? Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712046 Share on other sites More sharing options...
Alecdude Posted December 10, 2008 Author Share Posted December 10, 2008 Did you rename the "example" in the query to your table name? Yeah... just noticed that... XD This topic will be solved unless further problems arise, in which case I shall bump it. Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712049 Share on other sites More sharing options...
Alecdude Posted December 11, 2008 Author Share Posted December 11, 2008 Ignore this; I figured it out. Link to comment https://forums.phpfreaks.com/topic/136430-solved-theres-something-wrong-with-this-script-integer-checking-script/#findComment-712139 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.