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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Confusing...

Status
Not open for further replies.

perlone

Programmer
May 20, 2001
438
US
Hi,

Once again I'm writing a script that uses lots of subroutines like explore.cgi?mode=forums. Here's half of my code.

if ($query =~m/warehouse/) {
&explore(qq
~<form
action=&quot;explore.cgi?&mode=visit&quot;
method=&quot;POST&quot;>
<p><font size=&quot;2&quot; face=&quot;Arial&quot;><strong>IK: </strong>Visit
Warehouse No:<br>
</font><select name=&quot;number&quot; size=&quot;1&quot;>
<option value=&quot;1&quot;>1</option>
#rest of my HTML code
~, &quot;Warehouses&quot;);

SECOND PART OF MY SCRIPT

if ($query =~m/forums/) {
&explore(qq~
form action=&quot;msgpost.cgi&quot; method=&quot;POST&quot;>
#more HTML codes then...
</center></div><p align=&quot;center&quot;><input type=&quot;submit&quot;
value=&quot;Post&quot;> <input type=&quot;reset&quot; value=&quot;Clear&quot;></p>
~,&quot;Forums&quot;);

PROBLEM: As you can see now there's 2 parts of forms with 2 urls. One from the first subroutine, which is explore.cgi?mode=visit and the other from the subroutine, &quot;forums&quot; which is msgpost.cgi. Somehow when I go to the forums section and click on the &quot;Post&quot; to post a message, perl is redirecting to explore.cgi?mode=warehouse instead of msgpost.cgi. I think perl got confused or something within the 2 subroutines but can anyone help me fix this? Thanks for your time.

-Aaron





 
<form action=&quot;explore.cgi?&mode=visit&quot; method=&quot;POST&quot;>

You're mixing two methods of passing parameters to a CGI script: GET and POST. Don't. Put the mode into a hidden variable.

<form action=&quot;explore.cgi&quot; method=&quot;POST&quot;>
<input type=hidden name=mode value=visit>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top