• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 147
  • Last Modified:

Creating frames

I have created frames ... and I want the LEFT side to be static and the RIGHT side should show the results...
how to do this ?

For ex. pls. check out my site at
http://pegasus.csci.csusb.edu/public/grad/sdesar/frameURL.html


Awaiting a response
0
sdesar
Asked:
sdesar
  • 2
  • 2
1 Solution
 
andropovCommented:
Make the form tag like this:

<form name="your_form" ACTION="your_actionpage" method="GET" target="your_rightframe">

//Andropov
0
 
sdesarAuthor Commented:
I am still getting the output on the left side.

I can't figure out why this is occuring eventhough I am getting correct results in the respective files

 have included the files that this effects... hope this helps!!!!!!!

Thanks for the response!!!!!

The suggestion you made i did it on my frames .html page

<HTML>
                       <HEAD>
                        <TITLE>Page with targeting</TITLE>
                       </HEAD>
                      <FRAMESET COLS="30%,70%">
<form name="url_fetch.html" ACTION="hello.html" method="GET"
                   target="url_fetch.cgi">
                        <FRAME SRC=url_fetch.html>
                        <FRAME SRC=fr-txt11.html NAME="results">
                      </FRAMESET>
                      </HTML>      

And here the .cgi File where I enter in the URL -

#!/usr/bin/perl


use LWP::Simple;
use HTML::Parser;
use CGI;

my $cgi = new CGI;
my $url = $cgi->param('url');

my $HTTP_ROOT = "/web/public/grad/sdesar/file.txt";
my $HTTP_ROOT1 = "/web/public/grad/sdesar/file.html";


if ( $url ne "" )
{
$content = fetch( $url );
if ( $content ne "" )
{
print $cgi->header( -type => 'text/plain' );
my $plain_text = plain_text($content);
print $plain_text;
print $content;                    
my $plain_text = plain_text( $content );

print $plain_text, "\n";

cp_to_file( $plain_text, "$HTTP_ROOT" );
print $cgi->redirect( "/file.txt" );

##########copy the HTML

print $cgi->header( -type => 'text/plain' );
my $cp_to_file_html = cp_to_file_html($content);
print $cp_to_file_html;
print $content;
my $cp_to_file_html = cp_to_file_html( $content );

print $cp_to_file_html, "\n";

cp_to_file_html( $cp_to_file_html, "$HTTP_ROOT1" );
print $cgi->redirect( "/file.html" );



}
else
{
output_form( "Could not load URL: $url<br>" );
}
   sub output_form
{
my $msg = shift;

# output the html header
print $cgi->header( -type => 'text/html' );

# print the message if there is one
print "$msg<br>\n";

# output the form for the user
print $cgi->start_html;
print $cgi->start_form;
print "Please enter another URL:  ";  
print $cgi->textfield( -name=>'url', -override=>' ' );
#print $cgi->textfield('url');
print $cgi->br;
print $cgi->submit( -label => 'Fetch' );
print $cgi->end_form;
print $cgi->end_html;
}
#### subroutines
sub fetch {
my ($url) = @_;
my $cont;

$cont = get($url);
return $cont;
}
   # copies text to file

sub cp_to_file {
my ($text, $to_file) = @_;

open(OUT, ">" . $to_file);
print OUT $text;
close(OUT);
}

# copies file at HTML to a file

sub cp_to_file_html {
my ($text, $to_file) = @_;

open(OUT, ">" . $to_file);
print OUT $text;
return $text;
close(OUT);
}      
   # converts html text into plain text; (simplistic approach)

sub plain_text {
my ($in_text) = @_;
my $plain;

($plain = $in_text) =~ s/<[^>]*>//gs;

return $plain;
}
                 
                         


                   
       
0
 
andropovCommented:
Ahhh, OK!

1. Remove the <form>-tag from your "frames.html" file.

2. The form-tag in your file "url_fetch.html" should be substituted with this one:

<form name="f1" ACTION="url_fetch.cgi" method="GET" target="results">

//Andropov
0
 
sdesarAuthor Commented:
I impelemeted your suggestion, but its still not working.  The output still appears on the Left side
when I enter the URL.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now