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

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.

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.

<?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>"; 

}?>

<?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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.