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
KEYNAV(1)						      General Commands Manual							 KEYNAV(1)

NAME
keynav - a keyboard-driven mouse cursor mover SYNOPSIS
keynav DESCRIPTION
Keynav makes your keyboard a fast mouse cursor mover. You can move the cursor to any point on the screen with a few key strokes. It also simulates mouse click. You can do everything mouse can do with a keyboard. HOW TO USE
Run keynav, and activate it by pressing Ctrl+; (semicolon). You should see a thin frame on the screen with a cross in it. Default configuration: * h : select the left half of the region * j : select the bottom half of the region * k : select the top half of the region * l : select the right half of the region * Shift+h : move the region left * Shift+j : move the region down * Shift+k : move the region up * Shift+l : move the region right * Semicolon: move the cursor to the center of the selected region * Spacebar : move the cursor and left-click * Escape : cancel the move CONFIGURATION
You can configure your own key setting. There is an example in /usr/share/doc/keynav/keynavrc. Copy it to $HOME/.keynavrc and edit it as you like. CONFFILE COMMANDS
* start : activate keynav * end : deactivate keynav * cut-left : select the left half of the region * cut-right : select the right half of the region * cut-up : select the top half of the region * cut-down : select the bottom half of the region * move-left : move the region left * move-right : move the region right * move-up : move the region up * move-down : move the region down * warp : move the cursor to the center of the selected region * click 1 : left-click * click 2 : middle-click * click 3 : right-click * doubleclick 1: left-click twice quickly * doubleclick 2: middle-click twice quickly * doubleclick 3: right-click twice quickly * drag <button> [keyseq]: toggle dragging mode for the given button Example: "drag 1 alt" to do a alt+click-drag * grid <rows>x<columns> : change the grid layout of the selection Example: "grid 2x3" to cut screen to 6 cells * cell-select <row>x<column>: select a specific cell in the grid * cell-select <cell> : select a specific cell in the grid AUTHOR
keynav was written by Jordan Sissel <jls@semicomplete.com>. This manual page was written by Wen-Yen Chuang <caleb@calno.com>, for the Debian project (but may be used by others). KEYNAV(1)
All times are GMT -4. The time now is 08:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy