1833555 Members
2990 Online
110061 Solutions
New Discussion

CGI Program using KSH

 
ashanabey
Advisor

CGI Program using KSH

Hi

I wrote a program call a another cgi script using ksh, but I find problem to call the second script both scripts in http:/myhost/cgi-bin/qry.cgi and get_color.cgi(secound scripts.)Message I am getting is page is missing cant find.

Any idea...? How to call the secound script

qry.cgi (First Script)
----------------------
print "content-type:text/html"
print ""
print ""
print ""
print "

Personality by Color MMMMM....!

"
print "
"
print " Pick A Color (RED, GREEN, BLUE, YELLOW) "
print ""
print "
"
print ""
print ""
print ""

get_color.cgi Secound Script
----------------------------
#!/usr/bin/ksh
print "content-type:text/html"
print ""
print ""
print ""
print "

YOOOOOOOOOOO

"
name_value_pair=$QUERY_STRING
your_color=${name_value_pair#color=}
print "

$your_color

"
print ""
legend the heart and lend the hand
4 REPLIES 4
Hein van den Heuvel
Honored Contributor

Re: CGI Program using KSH


Maybe the second program is not executable?
This typically happens after an ftp (or for a newly editted script).
Try chmod +x /data/web/public/cgi-bin/sscan/get_color.cgi

Double check with ls -l before and after.

Also... you may want to consider using perl for this kind of stuff. It has good support for cgi work. And you are not going to use much of the stuff shells are good at: invoking and organized series of commands.

fwiw,
Hein.
ashanabey
Advisor

Re: CGI Program using KSH

Hi

I have given 777 to borth files what I find
is CGI ENV varible $QUERY_STRING not geting
the color in put from the first program

Any idea to how get the value

Rgs,
Ashan
legend the heart and lend the hand
Mark Grant
Honored Contributor

Re: CGI Program using KSH

I might be missing something but should the following line

print ""

be something like

print ""
Never preceed any demonstration with anything more predictive than "watch this"
Ralph Grothe
Honored Contributor

Re: CGI Program using KSH

Is the dirname part of the URI /data/web/public/cgi-bin/sscan/get_color.cgi (from your script's form tag) a webserver valid ScriptAlias, or is in your httpd.conf (supposed your webserver being Apache) a or block that adds an Option ExecCGI ?
Madness, thy name is system administration