Is there a way to send the exit; command to a location on the .php file? Here's what I'm trying to do. I want a login page. If the user failed to have the proper authorization, I want to terminate the page from displaying. However, I want to execute the php Exit command at the very end of the </html> tag. Is this possible? The problem of not doing this is that any javascript that comes after the php exit command will not get executed if the php exit command is in the middle of the page. So this is why I like to know if there is a way to exit the exit at the very end of any code.
I have tried function calling...but only to find out that the exit command will get excuted at the location of the function calling and not the location of where the exit command is written.
Any help is greatly appreciated.
ljCharlie
How to send exit; comand to other location?
Moderator: General Moderators
well of course. just do something like this
Code: Select all
<?php
//temp IF statement.. replace with whatever it is you are trying to use...
if($password != $mypassword)
{
?>
html data here....
Javascript Here....
html data here....
</html>
<?php
exit;
}
?>