CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
starting a sub routing AFTER a form is completed

 



ultimategamer2k
User

Feb 2, 2001, 10:11 AM

Post #1 of 3 (341 views)
starting a sub routing AFTER a form is completed Can't Post

how would i start a subroutine AFTER a form is submitted?

visit my web site at http://ultimategamer.cjb.net


slauzier
Deleted

Feb 2, 2001, 11:06 AM

Post #2 of 3 (340 views)
Re: starting a sub routing AFTER a form is completed [In reply to] Can't Post

what kind of form? you could just throw an if statement in to catch a value returned by the form, then start the sub if the condition is met.....like this


Code
if ($contents{'form'} eq 'some_thing') { 
&some_sub();
}



ultimategamer2k
User

Feb 2, 2001, 11:19 AM

Post #3 of 3 (339 views)
Re: starting a sub routing AFTER a form is completed [In reply to] Can't Post

the code
---------------------------code---------------------------------------
print <<beginningHTML;
<form method="POST" action="admin.cgi">
<div align="center" style="width: 620; height: 130">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="80%" bgcolor="#333333">
<tr>
<td width="100%">
<p align="center"><b><font size="1" face="Verdana">..::Adding Codes::..</font></b>
<div align="center">
<table border="2" cellpadding="0" cellspacing="0" width="95%" bgcolor="#060735" bordercolor="#000000">
<tr>
<td width="8%" bgcolor="#060735"> </td>
<tr>
<td width="8%" bgcolor="#A8A8A8"><b><font face="Verdana" size="1">Number</font></b></td>
<td width="42%" bgcolor="#A8A8A8"><b><font face="Verdana" size="1">Code Description</font></b></td>
<td width="50%" bgcolor="#A8A8A8"><b><font face="Verdana" size="1">Code</font></b></td></tr>
beginningHTML


for ($count = 1; $count <= $numberCodes; $count++){
print <<loopHTML;
<tr>
<td width='8%'><b><font face='Verdana' size='1'>$count</font></b></td>
<td width='42%'><b><font face='Verdana' size='1'><input type='text' name='description$count' size='20'></font></b></td>
<td width='50%'><b><font face='Verdana' size='1'><input type='text' name='code$count' size='20'></font></b></td>
loopHTML
}

print <<endHTML;
<tr>
<td width="8%"><b><font face="Verdana" size="1">User</font></b></td>
<td width="92%" colspan="2"><b><font face="Verdana" size="1"><input type="text" name="user2" size="20"></font></b></td>
<tr>
<td width="8%"><b><font face="Verdana" size="1">Pass</font></b></td>
<td width="92%" colspan="2"><b><font face="Verdana" size="1"><input type="password" name="pass2" size="20"></font></b></td>
<tr>
<td width="8%"><font face="Verdana" size="1"><b><input type="submit" value="Submit"></b></font></td>
<td width="92%" colspan="2"><font face="Verdana" size="1"><b><input type="reset" value="Reset"></b></font></td>
</table>
</div>
</form>
</center>
------------------------/code----------------------------------

visit my web site at http://ultimategamer.cjb.net

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives