Re: CLOSE button or <a href""> link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 07:18 22/12/2005, you wrote:
From: "Ron Piggott (PHP)" <ron.php@xxxxxxxxxxxxxxxxxx>
Reply-To: ron.php@xxxxxxxxxxxxxxxxxx
To: PHP DB <php-db@xxxxxxxxxxxxx>
Content-Type: text/plain
Date: Thu, 22 Dec 2005 02:22:00 -0500
Message-Id: <1135236120.4014.20.camel@xxxxxxxxxxxxxxxxxxxxx>
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: CLOSE button or <a href""> link


What I really want to have happen is for the CLOSE WINDOW button to
appear when this is loaded as a pop up window from our
online_offering_basket.html file and if the web page is loaded directly
then the link to our Online Offering Basket appear for the user to get
back into our web site.

Do you know how to do this?


Yes, and this is a client side javascript problem unless you create the popup page using a PHP script. AFAIK from your file paths, it's HTML so PHP (and indeed, DB "databases", the subject of this discussion group) don't apply here.

You need to run a short snippet of javascript to determine if there's a "window.opener" object : That will point back (and have a .location.href property) of the opening page. I'd check for

<script language="javascript1.2" type="text/javascript">
if (window.opener != null) {
//      (Probably) sent here from the online_offering_basket.html page
//      Check that though to prevent spoofing :
if (window.opener.location.href.indexOf('online_offering_basket.html' != -1) { document.write('<a href="#" onclick="self.close()">Close Window</a>');
        } else {
document.write('<a href="http://www.actsministrieschristianevangelism.org";>Back To Site</a>');
        }
} else {
//      Linked directly from the how_we_operate_our_benevolent_fund.html  page
document.write('<a href="http://www.actsministrieschristianevangelism.org";>Back To Site</a>');
}
</script>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux