User(s) browsing this thread: 1 Guest(s)
|
Passing parameters to a CGI program
|
|
03-20-2009, 11:30 AM
|
|||
|
|||
|
Passing parameters to a CGI program
I am trying to write a cgi program which takes some parameters. I have the following test cgi file:
Code: #!/bin/shIf I call it like this, $1 comes through as expected (I use the Play button to activate the link): Code: <a href="http://localhost.drives:8883/HARD_DISK/test.cgi?test" TVID="PLAY"/>However, if I try to set up a variable like this, it does not work as expected: Code: <a href="http://localhost.drives:8883/HARD_DISK/test.cgi?INPUTPARM1=test" TVID="PLAY"/>Multiple input variables are also not working as expected: Code: <a href="http://localhost.drives:8883/HARD_DISK/test.cgi?INPUTPARM1=test&INPUTPARM2=test" TVID="PLAY"/>Am I doing something wrong? Is what I am trying to do even possible? |
|||
|
03-20-2009, 11:36 AM
|
|||
|
|||
|
RE: Passing parameters to a CGI program
You are doing nothing wrong, just all the HTTP GET parameters are stored in $1.
You need to manually split them to correct variables. More information is available here: http://bash-hackers.org/wiki/doku.php/mi...ashfaq/092 Easy way of installing software on your NMT using just your mouse: NMT Community Software Installer |
|||
|
03-20-2009, 11:43 AM
|
|||
|
|||
|
RE: Passing parameters to a CGI program
Ah right, of course.
Thanks for the quick reply. I saw examples somewhere of being able to pass in key/value pairs to a CGI, but I guess those programs were manually splitting the parms as you suggest. |
|||
|
« Next Oldest | Next Newest »
|

Twitter
Facebook
NMT Wiki
Search
Member List
Help
A-400 [13 May 2013]




![[+]](images/collapse_collapsed.gif)

