Forum Moderators: coopster & phranque

Message Too Old, No Replies

Redirection in CGI

using forms, perl

         

Drewser

4:54 pm on Jun 13, 2003 (gmt 0)

10+ Year Member



Right now, I am using the CGI.pm, and need to be able to redirect to a different url through a button. My problem is, that I want to set a perl variable at the same time to linking to the url (happens to be current url, the perl variable is set to make other things take place in script). All this is within form tags. Anyone know what to do?

Drewser

4:56 pm on Jun 13, 2003 (gmt 0)

10+ Year Member



Here's the code btw,

use CGI;
$query = new CGI;

print $query->header;

print $query->start_html("HTML stuff");
print "<H1>Yoda!</H1>\n";

print "<A NAME=\"beginning\"></A>\n";

$query->hidden(-name=>'hidden_name',-default=>'false');
print $query->hidden('hidden_name');

print $query->startform('POST','CIR_editor.cgi');
print $query->textfield('savedinfo','');

$myself=$query->self_url;

********** Don't know what to do here**********
print $query->button(-name=>'More HTML',-value=>'Rest of Form',-onClick=>'window.location = "http://129.153.130.40/CIR/cgi-bin/disappear.cgi#beginning"');
***********************************************

$query->hidden('hidden_name','true');
print $query->hidden('hidden_name');
print $query->submit('End');

$test = $query->param('hidden_name');
if($test eq 'true'){
print "<br>"; print "<br>";
print $query->textfield('otherinfo','');
print "SUCCESS!";
}

print $query->endform;

print $query->end_html;