Re: Popup page
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Popup page

From: Janwillem Borleffs <jw@jwscripts.com>
Date: Sun Jul 31 2005 - 12:16:48 CEST

Shelly wrote:
> I would like to have a popup page. In case of errors, I would like
> to have a separate page (of small size) pop up with the error
> message. How can I make this happen? It would make life much easier.
>

Seperate page:

if ($error) {
    header("Location: http://yoursite.com/errorpage.php?error=1");
    exit;
}

Popup page:

if ($error) {
    $url = "http://yoursite.com/errorpage.php?error=1";
    print "<script>window.onload = function () {
window.open('$url');}</script>";
}

The Seperate page solution should be included at the top of each page
(before anything else has been outputted); the Popup page solution should be
between the <head /> tags of each page. The error parameter gets translated
into an appropriate message on errorpage.php

It's up to you to decide if this really makes life easier.

JW
Received on Tue Oct 18 02:06:33 2005