Posted by Janwillem Borleffs on 07/31/05 13:16
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
Navigation:
[Reply to this message]
|