Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Retrieve query_string on my CGI in ksh/html ? Post 303044528 by Tim2424 on Tuesday 25th of February 2020 10:20:58 AM
Old 02-25-2020
Retrieve query_string on my CGI in ksh/html ?

I've this ksh script in my CGI :

Code:
SERV_LINUX=$(cat /xxx/xxx/xxx/xxx/xxx/xxx/foo.txt | awk -F';' '{print $2}' | sort | uniq)
    
    DATE_Linux=$(cat /xxx/xxx/xxx/xxx/xxx/xxx/foo.txt | awk -F';' '{print $3}' | sort | uniq)

    echo "<form action="LINUX_GNU.ksh" method="post">"
    echo "<select name="SERV">"
    echo "$SERV_LINUX" | while read SERV_LINUX; do
    echo " <option value="$SERV_LINUX">$SERV_LINUX</option>"
    done
    echo "</select>"
    
    echo "<select name="DATE_Linux">"
    echo "$DATE_Linux" | while read DATE_Linux; do
    echo " <option value="$DATE_Linux">$DATE_Linux</option>"
    done
    echo "</select>"
    
    echo "<input type="submit" value="Select">"
    echo "</form>"
    
     echo "</div>"

This piece of script create a dropdown menu which allow to choose a server. On my second page, If I put this :

Code:
read a 
echo $a

I'm able to retrieve the query string like this :

Code:
SERV=my_serv&DATE_Linux=2019-10

I want to know if it's possible to do the same things but only with button ? I mean, If I've 4 options in my dropdown menu, I would like to create 4 buttons, like that :

Code:
SERV_LINUX=$(cat /xxx/xxx/xxx/xxx/xxx/xxx/foo.txt | awk -F';' '{print $2}' | sort | uniq)

echo "<form action="test.ksh" method="post">"
echo "$SERV_LINUX" | while read SERV_LINUX; do
echo "<input type="submit" value="$SERV_LINUX">"
done
echo "</select>"
echo "</form>"

One button for each options of the dropdown. When I will click on the button, a new page will open with the result :

Code:
SERV=my_serv

But When I try that, I've no result... Do you think it's possible ? Do u have any idea to do this ?

Thanks ! Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

HTML-CGI on Unix

AAAHHH!! I've made a perl program that you can run on a web browser. This program needs to be run everyday, and I don't want to have to run it everyday. The problem is when I try running the program from my terminal, all it does is print stuff to the terminal page (the program involves a lot of... (4 Replies)
Discussion started by: sstevens
4 Replies

2. Shell Programming and Scripting

HTML form to cgi help

I wrote a script to automate user account verification against peoplesoft. Now I want to make it available to my peers via the web. It is running on Solaris. I have the form written, but am not sure how to make it work. I think the form should call a perl cgi when submitted. The cgi should call... (7 Replies)
Discussion started by: 98_1LE
7 Replies

3. Shell Programming and Scripting

html - df -k cgi script

Hey - I am new to cgi scripting... just writing a script to output df -k output to html page... but I cannot get the df lines on separate lines on the page, it all comes out on one line and is not very readable.. any suggestions? My script is below - please keep in mind I am only new to it so... (1 Reply)
Discussion started by: frustrated1
1 Replies

4. Shell Programming and Scripting

cgi script to echo a html file

Hi, I'm learning some simple cgi scripting. I can make a script like this, so my browser shows "Hello World" /www/cgi-bin/name.sh --- #!/bin/sh MyName=World echo "<html> Hello $MyName </html>" --- What I'd like is to have a separate html and script files in the cgi folder so ... (1 Reply)
Discussion started by: Performer
1 Replies

5. Shell Programming and Scripting

How to pass data from server (CGI script) to client (html page)

Hi I know how to pass data from client side (html file) to server using CGI script (POST method). I also know how to re-create the html page from server side after receiving the data (using printf). However I want to write static pages on client side (only the structure), and only to pass... (0 Replies)
Discussion started by: naamabm
0 Replies

6. UNIX and Linux Applications

execute shell script using CGI for html site

hi there im currently in the process of creating a website for use basically within our org. im using a os x machine and installed MAMP - which includes Apache, mysql... the site will be used by techs to primarily install pkgs files onto os x devices. i would like to have buttons or hyperlinks... (2 Replies)
Discussion started by: sheshe
2 Replies

7. Shell Programming and Scripting

Javascript or HTML to retrieve apache username

I have a internal wesbite set up and any visitor must enter username / passwd as defined in apache (I've set these up using htpasswd) I use cgi scripts set up using ksh or javascript to populate pages / tables etc. I want to be able to get the apache username that the used authorised... (3 Replies)
Discussion started by: frustrated1
3 Replies

8. Shell Programming and Scripting

Retrieve information Text/Word from HTML code using awk/sed

awk/sed newbie here. I have a HTML file and from that file and I would like to retrieve a text word. <font face=arial size=-1><li><a href=/value_for_clients/Tokyo/abc_process.txt>abc</a> NDK Version: 4.0 </li> <font face=arial size=-1><li><a... (6 Replies)
Discussion started by: sk2code
6 Replies

9. Shell Programming and Scripting

Run command through html+cgi in bash

Hi everyone, I want to kill process through the web, so I create html page with single bottom that run kill command in shell script with CGI. Here is html code: <td><form METHOD="GET" action="http://IP:port/cgi_bin/script.cgi" > <input type="submit" value= "Submit" > <INPUT name="q"... (7 Replies)
Discussion started by: indeed_1
7 Replies

10. UNIX for Beginners Questions & Answers

How to convert my /bin/sh script with cgi and html to run it on browser!??

Hello, I want to run this script on my CentOS 6 via browser : ________________________________________________________________________________________________ #!/bin/sh echo Username? read MY_NAME echo Provisional file name? read MY_FILE echo File NAME you want to save? read MY_FILE2... (16 Replies)
Discussion started by: juta2020
16 Replies
HOBBIT-ACKINFO.CGI(1)					      General Commands Manual					     HOBBIT-ACKINFO.CGI(1)

NAME
hobbit-ackinfo.cgi - Xymon CGI script to acknowledge alerts SYNOPSIS
hobbit-ackinfo.cgi DESCRIPTION
hobbit-ackinfo.cgi is invoked as a CGI script via the hobbit-ackinfo.sh CGI wrapper. hobbit-ackinfo.cgi is used to acknowledge an alert on the Xymon "Critical Systems" view, generated by the hobbit-nkview.cgi(1) utility. This allows the staff viewing the Critical Systems view to acknowledge alerts with a "Level 1" alert, thereby removing the alert from the Critical Systems view. Note that the Level 1 alert generated by the hobbit-ackinfo.cgi utility does NOT stop alerts from being sent. In a future version of Xymon (after Xymon 4.2), this utility will also be used for acknowledging alerts at other levels. OPTIONS
--level=NUMBER Sets the acknowledgment level. This is typically used to force a specific level of the acknowledgment, e.g. a level 1 acknowledge when called from the Critical Systems view. --validity=TIME Sets the validity of the acknowledgment. By default this is taken from the CGI parameters supplied by the user. --sender=STRING Logs STRING as the sender of the acknowledgment. By default, this is taken from the loginname of the webuser sending the acknowledg- ment. --env=FILENAME Loads the environment defined in FILENAME before executing the CGI script. --area=NAME Load environment variables for a specific area. NB: if used, this option must appear before any --env=FILENAME option. --debug Enables debugging output. ENVIRONMENT VARIABLES
BBHOME Used to locate the template files for the generated web pages. QUERY_STRING Contains the parameters for the CGI script. SEE ALSO
hobbit-nkview.cgi(1), xymon(7) Xymon Version 4.2.3: 4 Feb 2009 HOBBIT-ACKINFO.CGI(1)
All times are GMT -4. The time now is 10:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy