Hi, I have a PHP script, here...
Quote: <?
session_start();
if(!session_is_registered(username)){
header("location:SOMEPAGE");
}
?>
and I wanted to convert the...
Quote: header("location:SOMEPAGE");
To do this...
Quote: <script language="javascript">
function UpdateClose()
{
opener.window.location = "SOMEPAGE";
self.close();
}
</script>
Can someone please tell me if this is possible, and if so, how it can be done?
Thanks in advance.







pr0gr4mm3r posted this at 14:23 — 30th November 2007.
He has: 708 posts
Joined: Sep 2006
What exactly are you trying to accomplish?
Reece S posted this at 15:17 — 30th November 2007.
He has: 172 posts
Joined: Oct 2007
A downloader file.
It boots up in a popup window, and if they are loggin in, it converts the popup window into a "save file" window.
if they are not, it closes the window, and directs the main page into the login area.
with me?
pr0gr4mm3r posted this at 15:37 — 30th November 2007.
He has: 708 posts
Joined: Sep 2006
Is the "save file" window one of your pages, or are you referring to the browser's safe file dialog?
Reece S posted this at 15:41 — 30th November 2007.
He has: 172 posts
Joined: Oct 2007
The browser default.
pr0gr4mm3r posted this at 15:45 — 30th November 2007.
He has: 708 posts
Joined: Sep 2006
I'm thinking you don't need a popup window at all then. Just use a PHP conditional. Redirect them to the file if they are active, or redirect them to the login page if they are not.
<?phpsession_start();
if(!session_is_registered(username)){
header("Location: LOGIN\");
}
else
{
header(\"Location: FILE\");
}
?>
Reece S posted this at 15:49 — 30th November 2007.
He has: 172 posts
Joined: Oct 2007
ahh, of course.
I was doing it wrong, the success status would leave the page as it is, and just open the file saver over the parent page.
the failed status would redirect the parent to login. this is great.
Cheers, i do make life complicated for myself. thanks a lot m8.