Jump to content

[SOLVED] There's something wrong with this script... (Integer checking script)


Alecdude

Recommended Posts

<?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
Share on other sites

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
Share on other sites

<?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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.