473,569 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

target="_top" in redirect

I have the following code in my cgi script. How would I use
target="_top" in the code below so that it would prevent my page from
opening in a frame.

Thanks,
Chris

*************** ******
my $url_1 =
'http://www.company.com/cgi-bin/company.cgi/_address?for_sa le=&_act=query& _dbf=retailol.d bf&_tar=_ret_m& ';
my $query1 = $query->query_string ;
my $query2 = join('',$url_1, $query1);

my $query3 = length($query2) ;
my $query4 = substr($query2, 0,450);
print $query->redirect($quer y4);
*************** ******

Jul 23 '05 #1
4 7363
so**********@ya hoo.com wrote:
I have the following code in my cgi script. How would I use
target="_top" in the code below so that it would prevent my page from
opening in a frame.

Thanks,
Chris

*************** ******
my $url_1 =
'http://www.company.com/cgi-bin/company.cgi/_address?for_sa le=&_act=query& _dbf=retailol.d bf&_tar=_ret_m& ';
my $query1 = $query->query_string ;
my $query2 = join('',$url_1, $query1);

my $query3 = length($query2) ;
my $query4 = substr($query2, 0,450);
print $query->redirect($quer y4);
*************** ******


ummm, WTF does this have to do with Javascript?

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Jul 23 '05 #2
In article <11************ **********@z14g 2000cwz.googleg roups.com>,
so**********@ya hoo.com wrote:
I have the following code in my cgi script. How would I use
target="_top" in the code below so that it would prevent my page from
opening in a frame.


There is code to prevent a page from opening in a frame. I do not know
about _top.

I have seen but not tried:

if (self != top) {top.location.h ref = self.location.h ref}

Robert
Jul 23 '05 #3
Thanks Robert. Put the code in my script and it works great.

Chris

Jul 23 '05 #4
Robert wrote:
<snip>
There is code to prevent a page from opening in a frame.
I do not know about _top.

I have seen but not tried:

if (self != top) {top.location.h ref = self.location.h ref}


In cases where there is a desire to break out of a frame it is almost
certain that the frameset originates in a different domain than the
contents of the frame. As a result cross-domain security restrictions
will apply to any code attempting to break out of a frameset, applying
to the tests made and then to the action carried out in response.

Comparing - self - or - window - with top - should be safe, there are no
securi9ty concerns in that action, and they are both properties of the
global object of the executing script. However, there are security
concerns relating to the reading of the URL of a page originating in
another domain. Security restrictions can be expected to apply to
reading any properties of a - top - frame that originates on another
domain, and the - location - object can be expected to be expected to be
subject to those restrictions above other objects. The mere act of
reading top.location could be restricted, particularly as that object
traditionally type-converts to a string that represents the page's URL.
And you cannot assign to - top.location.hr ef - without effectively
reading - top.location - in the process, and so risking a security
exception at that point.

Of course browser security restrictions vary considerably, but I don't
think this formulation can be expected to work successfully in a
reasonable range of browsers. And there is no need to risk the problem
as assigning a URL string directly to - top.location - has the desired
effect without any need to read the value of the object.

Richard.
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2630
by: Rob McLennan - ZETLAND | last post by:
Hi, I'm relatively clueless when it comes to correct ASP syntax. I'm testing out a search form for my company's website which is done in ASP. The results are displayed as per the code shown at the very bottom of this message. All I want to do is add a target="top" to the URL which is displayed as a link at the top of the results. I know...
8
6702
by: Dave | last post by:
Hello, I have written a website www.pusspaws.net, my problem is in the gallery section. I have coded ... <object type="text/html" data="galleryobj.html" border="0" width="422" height="325"></object><br> to make a scrolling window (Or is it a frame with an <object> tab ?),
19
11176
by: Arthur Connor | last post by:
Currently I specified a TARGET attribute inside an <A> tag which is not allowed under strict XHTML. How do I change the line to meet the requirements of strict HTML? <A HREF="http://www.targetedomain.com/" TARGET="_top">...</A> Arty
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7982
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6286
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.