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:
perl CGI how to handle user inputs

 



akalapl
New User

Oct 18, 2011, 5:30 AM

Post #1 of 3 (559 views)
perl CGI how to handle user inputs Can't Post

Hello,

My html page is main.html :
--------------------------- main.html------------------
<HTML>
<BODY>
<h1 align="center"> "This is my main page" </h1>
<TABLE border="0" align="center">
<TR>
<TD>
<form action="../cgi-bin/mycgiscript.cgi" method="post">
<INPUT TYPE="submit" value="main" name="main" size="50">
</form>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
----------------- end main.html -------------------

mycgiscript.cgi is :

------------- mycgiscript.cgi --------------

#!/usr/bin/perl -w
use strict;
use CGI;
my $query = CGI ->new;

print $query->start_html('this is my cgi script page');
if($query->param("main") {
print $query->startform;
print $query->scrolling_list(-name=>"items",-values=>["red","green","dark", -size=>20,-multiple=>'false',-default=>'red');
print $query->br;
print $query->submit(-value=>'submit',-name=>"submit_items");
print $query->endform;
}
else {
print $query->h5('This is second part');
}
print $query->end_html;

--------------- end of mycgiscript.cgi ------------

I would like to get user selection and do something. For example if user selects "red" then i will reverse it and output as "der", if user selects "green" i will
output as "GREEN". I dont want to redirect to an other cgi script or file. I wish do it at the same file mycgiscript.cgi.


Could you help me?

Best Regards

Erdal


wickedxter
User

Oct 18, 2011, 6:12 AM

Post #2 of 3 (553 views)
Re: [akalapl] perl CGI how to handle user inputs [In reply to] Can't Post

your best be would be to use java to get what you want.


akalapl
New User

Oct 18, 2011, 6:49 AM

Post #3 of 3 (548 views)
Re: [wickedxter] perl CGI how to handle user inputs [In reply to] Can't Post

did you mean javascript ?

 
 


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

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