Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Programming > Server-Side Scripting
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-16-2005, 06:29 AM
Junior Member
 
Join Date: May 2005
Location: singapore
Posts: 1
Question Restrict Popup Window Call

Hello, Anyone ca help me
I want to protect the popup windows only can be initiated by a certain page. I don't want user just cut and paste this popup url then from surf from brwser:
Maybe mypop.htm should have code to validate where it has been created? If it is not belong to newpop var then exit! How to do this?



pagex.htm
.
function showPop(){

newpop=window.open("mypop.htm",.....)

}
<input type="button" name="popw" onClick="showPop()">
.
.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-16-2005, 09:13 AM
Ducani's Avatar
Administrator
 
Join Date: Sep 2004
Posts: 220
Default

Hi Kmarul,
Welcome to the forums.

This code below should achieve what you had in mind. Add this to the popup window page and ofcourse change the referring url.
Code:
<script language="Javascript">
if (document.referrer&&document.referrer!="http://www.yoursite.com/referringpage.html")
self.close();;
//-->
</script>

Last edited by Ducani : 05-16-2005 at 09:18 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
popup window brought to top cbesh2 Server-Side Scripting 0 03-06-2007 02:58 PM

All times are GMT -5. The time now is 09:05 AM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.