Solved

Redirecting within frames

Posted on 1998-07-25
5
147 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Example unit tests with AngularJS 3 45
how to pick specific file from ftp 13 58
Some AHK commands fail in Microsoft OneNote 5 48
powershell md/mkdir/New-item   -Quiet 10 47
Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
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…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

803 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