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' ? Link to comment https://forums.phpfreaks.com/topic/18709-php-die-function/ 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 Link to comment https://forums.phpfreaks.com/topic/18709-php-die-function/#findComment-80661 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 ;) Link to comment https://forums.phpfreaks.com/topic/18709-php-die-function/#findComment-80662 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 Link to comment https://forums.phpfreaks.com/topic/18709-php-die-function/#findComment-80663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.