Jump to content

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.

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.