[FX.php List] Best way to disable FX-based pages, with a nice message?

Tim 'Webko' Booth tim at nicheit.com.au
Tue Nov 15 17:35:25 MST 2011


Dear Troy,

> Tim, thanks. That looks good.
>
> Is there a reason the serverError variable should be a session  
> variable?
>
>
See below.

> To disable the rest of the page, would you just do something like  
> this?:
>
> 	if ($_SESSION['serverError'] != "0") {
> 		echo "Error: ".$_SESSION['serverError'];
> 	} else {
> ?>
>
> (entire normal page code/html)
>
> <?php } ?>
>
>
> ...adding the closing bracket at the end? Or is there a way to just  
> stop page generation in its tracks just with the lines added at the  
> top?

Actually, now I remember why - it's so I can transfer them to an error  
page using header('Location: error.php');

So to stop the page at that point and transfer them, you can use

> 	if ($_SESSION['serverError'] != "0") {
> 		header('Location: error.php');
> 	}

So no need to wrap the page code...

Cheers

T


More information about the FX.php_List mailing list