LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-20-2006, 04:04 PM   #1
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 112

Rep: Reputation: 16
Question CGI shell script (GET/POST?)


Let's say I have the below script (we'll call it sample.cgi)

Code:
#!/bin/sh
# sample script
echo "Content-type: text/html"
echo ""

echo "hello <h1>$name</h1>"
I'm running apache server and the script itself runs fine (It prints the word hello).

But, how do I create a HTML code that will send the 'name' variable from a textbox?

thanks
 
Old 09-20-2006, 07:27 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You have to extract the value of the 'name' parameter from either $REQUEST_URI or from $QUERY_STRING, depending on whether it is a POST or GET request. Start by doing
Code:
echo "$REQUEST_URI<BR>"
echo "$QUERY_STRING<BR>"
to see what I mean.

--- rod.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cgi shell script: ssh not working kitmui Programming 2 04-21-2010 02:46 PM
Launch CGI script from shell alex986best Linux - Newbie 2 06-28-2006 06:28 AM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
HELP:write a CGI program with shell script supermyself Programming 3 06-12-2005 03:10 PM
Why doesnt my simple html post to cgi script work? ginda Linux - Networking 10 03-15-2005 03:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration