Jump to content

something like break?


Hyaku_

Recommended Posts

[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
https://forums.phpfreaks.com/topic/33516-something-like-break/#findComment-157645
Share on other sites

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.