Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 12th, 2000, 09:16 AM
Pepe Pepe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 71 Pepe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
I have two frames page and script is called from form on 2nd frame. I don't want to put target="first" statement within <FORM> tag, because script has to decide to which frame to print, and I don't want to print both frames from script since there is lots of graphics.

Can I print from my perl script to specific frame on page without reloading second frame?

Reply With Quote
  #2  
Old August 12th, 2000, 12:34 PM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 9
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan

you can give a frame name in your perl script like the following..


#!/usr/bin/perl

print "Window-target: yourframenamen";
print "Content-type: text/htmlnn";

print "<html>n";
......
print ",/html>n";


------------------
SR -
webshiju.com
www.jobxyz.com-IT Career Portal
ezipindia.com--WebStudio


"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
  #3  
Old August 12th, 2000, 01:39 PM
Pepe Pepe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 71 Pepe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
I have tried this and it always print in same frame - the one from which script is called

if ($broj < 50){
print "Window-target: leftn";
print "Content-type: text/htmlnn";
print "This is first frame";
} else {
print "Window-target: rightn";
print "Content-type: text/htmlnn";
print "This goes to 2nd frame";
}

and I called script from page containing frames "left" and "right"

Reply With Quote
  #4  
Old August 13th, 2000, 05:32 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>Can I print from my perl script to specific frame on page

I also replied to the same questions dozen times.

>>I have tried this and it always print in same frame - the one from which script is called

Once again, this line ->
print "Window-target: yourframenamen";
is all you needed. If your if ($broj < 50){ example didn't work, it could be the problem with your script, you need to simplify your script to begin with.

However, I read a message here saying that "Window-target:" only work with Netscape, not with IE, I haven't used IE for long time, so I won't bother to test whether it's true or not with such non-standard browser. So please test it with Netscape first.

Reply With Quote
  #5  
Old August 13th, 2000, 06:43 AM
Pepe Pepe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 71 Pepe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
It si true, it works only with Netscape !

Reply With Quote
  #6  
Old August 13th, 2000, 07:01 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
What you could do is to ban IE users by detecting the HTTP_USER_AGENT output or require them to use Netscape only.

Or a work around would be to have your script rewrite the output of your form along with the <form ..target=..> tag, which is, requiring your users TWO clicks in order to get the actual output to the target frame. That also means the frame that contains your form would be self-loaded at least once.

Anyway, here is an example..

if (($ENV{'HTTP_USER_AGENT'} =~ /^Mozilla/) && ($ENV{'HTTP_USER_AGENT'} !~ /compatible/)) {
&netscape;
else {
&all_others;
}

sub netscape {
if ($broj < 50){
print "Window-target: leftn";
print "Content-type: text/htmlnn";
print "This is first frame";
}
else {
print "Window-target: rightn";
print "Content-type: text/htmlnn";
print "This goes to 2nd frame";
}
}
sub all_others {
if ($broj < 50){
print "Content-type: text/htmlnn";
print "<form method=POST action="script.pl" target="left">n";
print "<input type="hidden" name="whatever1" value="whatever1">n";
print "<input type="hidden" name="whatever2" value="whatever2">n";
print "<input type="submit" value="Since you are not using Netscape, please click here to continue">n";
print "</form>n";
}
else {
print "Content-type: text/htmlnn";
print "<form method=POST action="script.pl" target="right">n";
print "<input type="hidden" name="whatever1" value="whatever1">n";
print "<input type="hidden" name="whatever2" value="whatever2">n";
print "<input type="submit" value="Since you are not using Netscape, please click here to continue">n";
print "</form>n";
}
}

[This message has been edited by freebsd (edited August 13, 2000).]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > frames...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway