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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.