Sponsored Content
Top Forums UNIX for Dummies Questions & Answers CGI cannot get the Value after click the button. URGENT!!! Post 302337325 by ryanW on Thursday 23rd of July 2009 10:00:48 PM
Old 07-23-2009
CGI cannot get the Value after click the button. URGENT!!!

Hi Everyone,

I am facing a problem, regarding cgi cannot receive the value from HTML after click submit. Here is the code

===============================================
#!/bin/bash
genHTML()
{
cat <<-__EOF__
Content-type: text/html
<html>
<script language="JavaScript">
<!--
function trim(str)
{
str = str.replace( /^\s+/g, "" );// strip leading
return str.replace( /\s+$/g, "" );// strip trailing
}
-->
</script>
<body>
<form name=loginForm id=loginForm method=post action="login.cgi">
<table>
<tr>
<td colspan="2" class="LabelStyle1">LOGIN</td>
</tr>
<tr>
<td><b>User ID: </b>
<input type=text name=username value="" size="15"/></td>
</tr>
<tr>
<td colspan="2" class="blank">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="blank">&nbsp;</td>
</tr>
<tr>
<tr>
<td class="userPass">Password</td>
<td><input id="pwd" class="inputText" type="password" size="15" /></td>
</tr>
<tr>
<td colspan="2" class="blank">&nbsp;</td>
</tr>
<tr><td align=center>
<font color=red size="+6"><b>$ErrorMessage</b></font>
</td></tr>
<tr>
<td><font size=+1><input type=submit
name=btnLogin value="Login"></font>
</td>
<td><input type="button"
value="Clear" />
</td>
</tr>
<tr>
<td colspan="2" class="blank">&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>
__EOF__
}


echo "username=$username" >> aa.log

if [ "$username" == "123" ]
then
ErrorMessage="INVALID USER ID"
genHTML
elif [ "$username" == "333" ]
./nextpage.cgi
else
genHTML
fi
===========================================


I just wan to get the USERNAME name after the user key and click the button. But, USERNAME is empty that show in the log, seen like after click it will refresh to clear the USERNAME again. Do you know how to get the value after click the button? So, it can do the checking to display error message in the same page or run to other page. My purpose is just wan to know how to get the value after user key in then enter without clear the USERNAME.

Thank you
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling CGI Perl in Shell script [urgent]

All I want to call a perl program from my shell script. Please help me. I want to call through URL only. Like " http://www.test.com/CGI-bin/test?test=value" Please help to write this script. Thanx in advance. Thanking you Regards Deepak Xavier (0 Replies)
Discussion started by: DeepakXavier
0 Replies

2. UNIX for Dummies Questions & Answers

Left click select,right click copy

Hi all, when i ssh into my linux machine, i can do a double left click and then right click to paste it anywhere i need. However, on the actual machine, in the terminal, i cannot do a double left click and right click to paste it. i need to right click and select Copy followed by click click... (1 Reply)
Discussion started by: new2ss
1 Replies

3. Solaris

Comprehensive system documentation by button click

Guys There's a new WebPage where you can generate a comprehensive detailed system documentation by button click. Look at the example at https://sdoctool.sun.com/data/doc.php?ID=sdoctool&N=2 ;) Interested, go to Cheers (0 Replies)
Discussion started by: lebch
0 Replies

4. Solaris

executing cgi programs in solaris(B89) needed urgent help,pls!

Hi all, I am trying to execute cgi scripts on solaris, but everytime i get a internal server error... The syntax of my .cgi script is correct as ive checked.. Steps i followed 1.started apache 2.The UNIX and Linux Forums - Learn UNIX and Linux from Experts (in opera) 3.places my cgi scripts... (7 Replies)
Discussion started by: wrapster
7 Replies

5. Shell Programming and Scripting

Python- Changing background color on Button click

Hi, I am trying to write a python program which changes background color on click of button. However i am stuck up. Instead of changing the color currently it is creating a new frame every time. please look at the code and let me know how to correct it #!/usr/bin/env python from Tkinter... (0 Replies)
Discussion started by: vickylife
0 Replies

6. Shell Programming and Scripting

Help to create a Return Button using shell script CGI

Hello Guys, I would like to know how can I create a radio button on that its possible to return to the last page, using a ksh CGI shell script. Can someone help ? Thanks so much !!!:b: I tried this, but it is a javascript code ! <INPUT TYPE="button" VALUE="BACK" ... (2 Replies)
Discussion started by: robdcb
2 Replies

7. Shell Programming and Scripting

Validation of Text field while Click on submit button

I am using Perl CGI. I have created some text fields and getting those values. But i want if user leave the text field blank when he click on submit button then instead of run a script it should give a popup. Please any body suggest me something..??? (0 Replies)
Discussion started by: Navrattan Bansa
0 Replies

8. Shell Programming and Scripting

Create download button using perl CGI

Hi, I want to insert in a page a .html button that - once it is clicked - opens a save file dialog box by using perl CGI . I know that to create a link to do that I've done : print $cgi->p ( { -class => 'linc' },);I want to do something similar for a download button (0 Replies)
Discussion started by: black_fender
0 Replies

9. Web Development

Cannot execute sh file using button click in php file in apache

I the problem that i facing is cannot use button click to execute the sh file that store in the same location. the program file is a php file and running in apache2. the code that i run is show below <button onclick="sh()" name="sh">SH</button> <script type='text/javascript'> function sh()... (5 Replies)
Discussion started by: zhengkoon8
5 Replies

10. Shell Programming and Scripting

CURL Button Click Issue

I am trying to perform a button click via cURL and I am having an issue possibly due to java script on click. The HTML source code is: <input id="ctl00_SPWebPartManager1_g_1bb6dc86_55ab_4ea9_a4db_4747922a8202_ctl00_RequestOption_0" class="radio" type="radio" checked="checked" value="1"... (5 Replies)
Discussion started by: js0505
5 Replies
GZEXE(1)						      General Commands Manual							  GZEXE(1)

NAME
gzexe - compress executable files in place SYNOPSIS
gzexe [ name ... ] DESCRIPTION
The gzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a penalty in performance). For example if you execute ``gzexe /bin/cat'' it will create the following two files: -r-xr-xr-x 1 root bin 9644 Feb 11 11:16 /bin/cat -r-xr-xr-x 1 bin bin 24576 Nov 23 13:21 /bin/cat~ /bin/cat~ is the original file and /bin/cat is the self-uncompressing executable file. You can remove /bin/cat~ once you are sure that /bin/cat works properly. This utility is most useful on systems with very small disks. OPTIONS
-d Decompress the given executables instead of compressing them. SEE ALSO
gzip(1), znew(1), zmore(1), zcmp(1), zforce(1) CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the PATH environment variable to find gzip and some other utilities (tail, chmod, ln, sleep). BUGS
gzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases, using chmod or chown. GZEXE(1)
All times are GMT -4. The time now is 03:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy