Jump to content

it equals zero but im still getting an echo?


Allenph9

Recommended Posts

$test = substr_count($_POST['signature'], '>');

$test1 = substr_count($_POST['signature'], '<');

if ($_SESSION['logged_in'] != '1') {

static $the_echo = 'You need to be logged in!';

} elseif ($_POST['change_box2'] != 'CHANGE') {

static $the_echo = 'You must fill in the "CHANGE" box!';

} elseif ($test != '0') {

static $the_echo = 'Contains illegal characters!';

} elseif ($test1 != '0') {

static $the_echo = 'Contains illegal characters!';

}

}

echo $_POST['signature'];

echo $test;

?>

 

Those two echos a few lines above (echo $_POST['signature']; and echo $test;) come out to The Little Android and 0 yet it still echos illegal characters...what?

You're a bit right but mostly wrong. static is an object-oriented thing, yes, but <?php blocks are not classes.

 

If you're staying in the same file you don't need to "static" anything. The <?php blocks only control when PHP works; leaving one and entering another later won't affect your variables.

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.