chris_davidsonuk Posted August 26, 2006 Share Posted August 26, 2006 I am using login script I found at http://www.free2code.net/plugins/articles/read.php?id=99. It uses 'DIE' to stop the script when a username or password is incorrect. The problem I am having is that I have my menu at the bottom of the page which I include into the page. But if the user dosn't enter the correct username and password the script is terminated so the menu doesn't show.[code] if(!$_POST['uname'] | !$_POST['passwd']) { die('You did not fill in a required field.<br>'); }[/code]Is there anyway to include my footer file (footer.php) even if the script has 'DIED' ? Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 26, 2006 Share Posted August 26, 2006 noDIE() and EXIT() stop the script from executingThis should only really be used when there is a fear of hack attack Quote Link to comment Share on other sites More sharing options...
Orio Posted August 26, 2006 Share Posted August 26, 2006 But you can do:[code]<?phpif(!$_POST['uname'] | !$_POST['passwd']) {echo('You did not fill in a required field.<br>');include("footer.php");die();}?>[/code]Orio.PS- nice av ;) Quote Link to comment Share on other sites More sharing options...
Iceman512 Posted August 26, 2006 Share Posted August 26, 2006 Hi,The easy solution to your problem is to use this:[code]<?phpif(!$_POST['uname'] | !$_POST['passwd']) { echo 'You did not fill in a required field.<br>'; }?>[/code]This won't stop the script, but it will tell you when the condition has failed.Hope it works!Iceman Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.