Problem with while reading HTML inputs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with while reading HTML inputs
# 1  
Old 06-24-2009
Error Problem with while reading HTML inputs in cgi script

Hi All,

I am not able to read my HTML form inputs properly in my script.
I have a textarea in my form where user needs to enter sql query... but when user enter query like below :
select * from order_queue where NUM_OF_PICKUP >=3 and TRANSACTION_TYPE=4 ;

its coming like :
select 171_arc abn_daily abn_data_cmpltn abn_rpt abn_voice_cmpltn bvoip_rpt calnet_rpt cola_rpt common_gen_row_data common_rpt data_cmpltn data_ptl_cmplt data_rpt getcanx gov_login_add gvpn_rpt he_recap_cgi iom_db_tool iom_vol ipmis_acc_info_rpt ipmis_rpt le_arc le_cycle le_data le_new_vol le_new_vol_a le_recap_cgi le_rejects le_rpt le_saved le_svc_rpt le_vol local_daily_rpt local_legacy_daily_rpt local_rpt local_svc_rpt lpl_act_co lpl_ft n_nod_rejects networx_authenticate networx_dailyrpt networx_rpt networx_user_rpt nod_25 nod_acty nod_feat_data nod_ft_rpt nod_raw_data nod_recap_cgi nod_vol nod_vol_rpt pq_networx_dailyrpt pq_networx_rpt prime_act_co prime_ft prime_lpl_raw proccgi rejects sv_report swv_geo_acc_code_rpt tnet_networx_dailyrpt tnet_networx_rpt vol_report from order_queue where NUM_OF_PICKUP >=3 and TRANSACTION_TYPE=4 ;

From the above ouput, I found that the symbol "*" is getting replaced with all dir and subdir where my cgi script located....

How to get exact input which user enters in the textarea in my HTML form?

I tried like this in my cgi script :
echo "${FORM_input_query}"

Thanks in advance,
Saravana

Last edited by askumarece; 06-24-2009 at 12:25 PM..
# 2  
Old 06-24-2009
Doing "select *" isn't good form anyway. Only select the fields you want to return.

For example:

SELECT fname, lname, ordernum FROM order_queue WJERE NUM_OF_PICKUP >=3 AND TRANSACTION_TYPE=4 ;

If you absolutely must do a select * (and you don't) you can escape the * with a \. "SELECT \* FROM blah blah". But don't.
# 3  
Old 06-24-2009
Please avoid using shell script as CGI script. If you are using languages such as PHP or Perl for cgi, expansion of glob would not occur (automatically) and you should not encounter the same problem.
# 4  
Old 06-25-2009
Is there any way to get the exact value which I enter in the textarea (in my HTML form) in shell script?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem in sending inputs to format command using expect

Hi , I am not able figure out how to use expect tool to send input to this prompt of format Searching for disks...done selecting c0t3d0 FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition... (3 Replies)
Discussion started by: chidori
3 Replies

2. Shell Programming and Scripting

Having problem with how to use HTML in Unix shell scripting

Hi All, I'm new to this forum. This is my first question. I'm trying to automate the status related information in our environment. So this is how the output would be. SEGMENT SERVER PORT1 PORT2 PORT3 PORT4 PORT5 ACS acscsa01 up up up up up All... (2 Replies)
Discussion started by: anand.aswini
2 Replies

3. Shell Programming and Scripting

Problem in sending inline html with an attachment using sendmail

MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=border --border Content-Type: text/html Content-Disposition: inline <html><body><h2>This text should be displayed with html formatting</h2></body></html> --border Content-Type: text/plain Content-Disposition: attachment This text... (2 Replies)
Discussion started by: thulasidharan2k
2 Replies

4. Shell Programming and Scripting

on HTML form, Call Expect in Perl problem

Hi I have a successfullly run perl script (by issuing command "perl sub.pl" under shell mode) and this sub.pl will call sub.exp successfully. The sub.exp expect script is basically to login to a server and run some commands and put the output into a sub.txt file, it takes about 5 seconds to... (0 Replies)
Discussion started by: cxbest
0 Replies

5. Shell Programming and Scripting

Problem when extracting the title of HTML doc

Dear all. I need to extract the title (text between <title> and </title>) of a set of HTML documents. I've found a command that makes the work of extracting the text, but it does not always work. It works with the next example: cat a.txt htmltext<title>This is a HTML... (2 Replies)
Discussion started by: i007
2 Replies

6. UNIX for Advanced & Expert Users

problem mailing HTML code in cron file.

Hi All, I have written a script which sends mail using “sendmail” command and mail contains HTML code. When I run scripts on terminal it is working properly, but when I try to run this script through a crontab file it sends blank mail with proper subject. crontab file detail : 00 05... (1 Reply)
Discussion started by: abhishek.mind
1 Replies

7. Shell Programming and Scripting

Problem with 'sed' command while using HTML tags

Hello, I am using sed as follows - sed 's/CONTACT SYSTEMS! Some payments have been rejected/<B><font color="red" size="5.0pt"CONTACT SYSTEMS! Some payments have been rejected</font></B>/' $REPORT_FILE But while executing this, I am getting the error as - sed: command garbled &... (5 Replies)
Discussion started by: The Observer
5 Replies

8. Shell Programming and Scripting

html problem: get file name dialog exists?

Hello, I wonder whether if we have a open file dialog as (in gtk+) in html. I know that a submit-type form (such as <input value="Add File" type="submit">) opens such dialog, but it -naturally- tries to submit the file chosen. I only want to find out the file name, not upload it. Thanks! (0 Replies)
Discussion started by: f33ldead
0 Replies

9. Shell Programming and Scripting

Reading in two inputs from a file

Hi all, I've been assigned the task of modifying a script which reads in names of tables from a list file, exports a 30 days worth of data from these tables, then deletes the table. The list file will now contain a table name and a number next to it indicating how many days to archive. I need... (1 Reply)
Discussion started by: MadHatter
1 Replies

10. Shell Programming and Scripting

HTML display timing problem under ksh script

Using a HTML page , i'm running a Unix ksh script with <a href=..>. The script contains loop like this : for i in do rsh..... done each rsh command is running quite long and then i would display results in HTML format but about 5mn my blank page waiting for result is running in error... (1 Reply)
Discussion started by: Nicol
1 Replies
Login or Register to Ask a Question