Lite exit(1): what does it do exactly??

From: Richard Rothwell (R.Rothwell@latrobe.edu.au)
Date: Mon Oct 25 1999 - 08:09:44 EST


I have wriiten some Lite code that looks like this:

<TABLE >
    <TR >
        <TD>
<!-- Page Contents Goes Here -->
        <H2>
         Student: alter details
        </H2>
*--------------------------------------------------------------*/
$sock = ConnectDatabase("BestNet");
/*--------------------------------------------------------------*/
$staff_ID = ValidateStatus ($sock, $user_ID, $password);
if($staff_ID == "")
 {
 echo("Use the browser's back button to return to the authentication page.
\n");
 exit(1);
 }

.................... a whole lot of mixed lite and HTML goes
here...............

<!-- End of Page Contents -->
       </TD>
      </TR>
     </TABLE>

If the password/ user ID is incorrect the body of the if block is executed.
Before that ValidateStatus echos a message to web page saying the user is
not valid. There are a number of odd things about the behaviour of this code
though.

Firstly echo("Use the browser's back button to return to the authentication
page. \n"); does not produce a result in the web page.
I want this message to appear.

Secondly all of the lite code and HTML after the if block and up to but not
including the </TD> tag is ignored. But all of the HTML including the </TD>
tag and after is rendered correctly. This is the result I want. However it
implies that exit is a lot smarter than I had hoped. I was expecting exit()
to just to stop the Lite interpreter processing the page altogether.

Can someone explain what exit is actually supposed to do since it is not
actually documented.

Regards Richard

-------------------------------------------------------------------------
To unsubscribe, go to http://www.Hughes.com.au/extras/email/



This archive was generated by hypermail 2b30 : Mon Mar 04 2002 - 09:03:52 EST