Jump to content

can PHP do this?


AV1611

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.