Jump to content

something like break?


Hyaku_

Recommended Posts

[code]if(((time() - $user->last_activity)/60) > 20){ break; }
..
long peace of code..
[/code]
It works exactly like I want, except I'm getting:
[code]Cannot break/continue 1 level[/code]
is there something else as break or any other suggestions? Thanks!
Link to comment
Share on other sites

[quote author=emehrkay link=topic=121699.msg501589#msg501589 date=1168458367]
expalin what you are trying to do. i dont understand why you'd want to break at that point or what you expect the code to do if your statement is true
[/quote]

This is what I'm trying to do:
header.php
[code]if($timeout == TRUE){
    // if account expires display this message and stop executing the rest of the code
    echo $timout_msg; break;
}
..
[/code]
header.php will be included in every page, if user account timeouts, the statement will be executed and I don't want the rest of the code to be executed, thats why I use break, but I get that error.  So when the account is timeouted, this is what I get:
[quote]
Your account has been inactive for 29 minutes.
Please login again

Fatal error: Cannot break/continue 1 level in /var/www/htdocs/include/header.php on line 19[/quote]
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.