AV1611 Posted April 4, 2006 Share Posted April 4, 2006 I need a clause in a script that if it's false, the window displays a message for a few seconds then the browser popup closes, but if it's false, the page continues loading...I'm doing this, but it's a bad idea, and doesn't give the pause first...optionally, can window.close be delayed?Here is what I am currently doing...//code:IF ($row=mysql_fetch_array($result0)) { $_SESSION['auth']='auth'; $_SESSION['UserID']=$UserID; $_SESSION['pass']=$pass; } ELSE { print "SORRY, YOU ARE NOT AUTHORIZED TO CLONE PARTS"; echo '<BODY onLoad="window.close()">'; }echo "<body>"; Link to comment https://forums.phpfreaks.com/topic/6586-can-php-do-this/ Share on other sites More sharing options...
AV1611 Posted April 4, 2006 Author Share Posted April 4, 2006 I changed to this and it a little better, but it's still hokey...//code:IF ($row=mysql_fetch_array($result0)) { $_SESSION['auth']='auth'; $_SESSION['UserID']=$UserID; $_SESSION['pass']=$pass; } ELSE { print "SORRY, YOU ARE NOT AUTHORIZED TO CLONE PARTS"; echo "<BODY onLoad=\"alert('Invalid Password');window.close()\">"; } Link to comment https://forums.phpfreaks.com/topic/6586-can-php-do-this/#findComment-23899 Share on other sites More sharing options...
Barand Posted April 4, 2006 Share Posted April 4, 2006 Use a meta-refresh tag and set the time delay (5 sec inthe example). ELSE{print "SORRY, YOU ARE NOT AUTHORIZED TO CLONE PARTS";echo "<meta http-equiv='refresh' content='5; url=gotothispage.php'>";} Link to comment https://forums.phpfreaks.com/topic/6586-can-php-do-this/#findComment-23951 Share on other sites More sharing options...
AV1611 Posted April 4, 2006 Author Share Posted April 4, 2006 Barand, that is what I used to do, but the parent page of the popup is not the page I want it to go to. In other words, the main menu opens up a new browser that open up the popup. what that did is load the main page in a child from the starting page... I actually want to close the popup AND the child so you are back to the parent browser and main menu...Does that make sense? Link to comment https://forums.phpfreaks.com/topic/6586-can-php-do-this/#findComment-23962 Share on other sites More sharing options...
Barand Posted April 5, 2006 Share Posted April 5, 2006 You could use javascript's setTimeout() to call window.close after a specified time period.eg<BODY onload='setTimeout("window.close()", 5000);'> Link to comment https://forums.phpfreaks.com/topic/6586-can-php-do-this/#findComment-24142 Share on other sites More sharing options...
AV1611 Posted April 5, 2006 Author Share Posted April 5, 2006 Perfect![!--quoteo(post=361899:date=Apr 5 2006, 05:12 AM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Apr 5 2006, 05:12 AM) [snapback]361899[/snapback][/div][div class=\'quotemain\'][!--quotec--]You could use javascript's setTimeout() to call window.close after a specified time period.eg<BODY onload='setTimeout("window.close()", 5000);'>[/quote] Link to comment https://forums.phpfreaks.com/topic/6586-can-php-do-this/#findComment-24150 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.