Solved

Redirecting within frames

Posted on 1998-07-25
5
149 Views
Last Modified: 2013-12-25
I would like to make a dropdown box for navigating my site.

I'm using this line to change page:
print "Location: $myip/$url\n\n";

The problem is that the page shows in the same frame as the form im calling the perl script from. So how do i tell a perl script to use a target frame to open it's links in?

Hope someone can help.
CYA. Martin
0
Comment
Question by:freak022398
  • 3
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
alamo earned 50 total points
ID: 1831166
You might be able to do it from your script, but only for Netscape: Include a header line

Window-target: targetframe

I am not sure if it will work with a Location: redirect at all, normally Location is the only header line and the page referred to in the Location address might be the one which needs to include this header. I'll check.

But this is a Netscape-only extension to html, and isn't the best way to do it anyway. The best way to do it is in the html that calls your script. In the form tag for the form including your dropdown you should include target=targetframe. The output of the form (which is the location your script redirects to) will show up in the indicated frame.

Hope this helps!
0
 
LVL 6

Expert Comment

by:alamo
ID: 1831167
I just checked, and Window-target doesn't with with Location. So the better method turns out to be the only method anyway.
0
 

Author Comment

by:freak022398
ID: 1831168
I will have to find a solution that works on all browsers.
That's a must as i'm going to have a large Amiga public domain
archive.

I have tried different things, both in the perl and the html.
My table looks like this:

<FORM action="/cgi-bin/_go_page.pl" method="POST"><p>
  <select name="goto" size="1" >
    <OPTION Value="martin/home.html">Martin
    <OPTION Value="jacob/home.html">Jacob
  </SELECT>
  <input type="submit" value="Go">
</FORM>

And i have tried:
<OPTION Value="jacob/home.html" target="main">Jacob
(Without the $myip/ part in the perl parl.

So i don't know what couldt be wrong?

CYA. Martin.

0
 
LVL 6

Expert Comment

by:alamo
ID: 1831169
Change your form tag so it's:

<FORM action="/cgi-bin/_go_page.pl" method="POST" target="main">

and the location where _go_page.pl redirects to will show up in the frame "main".
0
 

Author Comment

by:freak022398
ID: 1831170
Great. That took care of that :)

Thanks for the fast reply.

CYA. Martin.

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question