Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cgi frames question

Status
Not open for further replies.

gregmosu

Programmer
Jul 8, 2002
117
US
In the right frame, I want anchor tags with variables.. and in the left frame, I want to grab the values of the parameters from those tags. How do I use the CGI object to grad those?

This is my code so far...
=======================================================
$qry = new CGI;

print $qry->header();

$frame_name = $qry->path_info();
$frame_name =~ s!^/!!;

if (!$frame_name)
{
print_frameset();
exit 0;
}

print $qry->start_html("Part Inquiry");
print_query() if $frame_name eq 'left';
print_response() if $frame_name eq 'right';
print_links() if $frame_name eq 'left';
print $qry->end_html();

sub print_frameset
{
my $script = $qry->url();
print $qry->title('Part Search'),
$qry->frameset({-cols=>'30%,70%'},
$qry->frame({-name=>'left',-src=>"$script/left"}),
$qry->frame({-name=>'right',-src=>"$script/right"})
);
exit 0;
}


===================================================
How do I write the anchor tags using the CGI method so that I can pick up the values in the left frame???

Thanks,
Greg
 
How are you attempting to get the information? Is this done on the server side or the client side. From you description you may need to use a combination of client side scription with server side scripting. Give a little more info so we can help?
 
well, I want an anchor tag in my left frame...

<a href='localhost/cgi-bin/form.cgi?id=3' target=right>link</a>

and I want to be able to grab this id in the right frame using the CGI object that I create.
eg.

#$qry is my CGI object
#code for getting param in left frame.

$id = $qry->param(inquiry_part1);



I hope this isnt too confusing, I'm still not very familiar with CGI programming in perl yet..

Thanks,
Greg
 
This is the syntax you need.
$id = $qry->param(inquiry_part1);
The item in red must match the parameter you passed id=3

This should do it
#$qry is my CGI object
#code for getting param in left frame.
use CGI;
$qry=new CGI;
$id = $qry->param(id);

print &quot;$id&quot;;#just to check to see if you picked it up
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top