Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sbox errors? Scripts won't run. Please Help...

Status
Not open for further replies.

tristero

Programmer
Jan 24, 2003
95
US
I'm having trouble getting my scripts to run...
i keep getting a SBox error:
"exec of /html/cgi/test.cgi failed (No such file or directory) "
But it DOES exist!
The script is in the correct cgi folder on the server, and the html is in the directory above it.
*the permissions on the cgi file are 'rwxr-xr-x'

Here is how i call the script("form.html"):
Code:
<form action=&quot;/cgi/test.cgi&quot;>

<input type=&quot;text&quot; length=&quot;20&quot; name=&quot;title&quot;><br>

<input type=&quot;submit&quot; value=&quot;submit&quot;>

</form>
[code]

[b]Here is the script(&quot;test.cgi&quot;):[/b]
[code]
#!/usr/bin/perl


my $in;
if ($ENV{'REQUEST_METHOD'} eq &quot;GET&quot;) {
        $in = $ENV{'QUERY_STRING'};
} else {
        $in = <STDIN>;
}

$in =~ s/\+/ /g;
$in =~ s/%(..)/pack(&quot;c&quot;,hex($1))/ge;
$in =~ s/=/ /g; 

print &quot;Content-type: text/html\n\n&quot;;
print &quot;<html><body>\n&quot;;

print &quot;You entered = $in&quot;;

print &quot;</body></html>\n&quot;;
[code]
Please help... Sbox is against me... 
Thank you, Dan
 
not sure. when I ftp in to the site, the cgi folder is visible in the top level of the site, and it's contents a step below that.
I am not hosing my own web server, so I believe that the company I am renting the space from sets it up so that it appears that i am in the directory &quot;/&quot; but in reality on their server it is &quot;/html&quot;.
 
You should ask your web host where your cgi programs should reside. And report this &quot;not found&quot; error to them if they say you should put them where you currently are. Sincerely,

Tom Anderson
Order amid Chaos, Inc.
 
Thank You. I have, and i will again. But, just so I know that I'm not crazy, my script is workable, isn't it?
 
If you got a &quot;no such file or directory&quot; error, then it really doesn't matter whether the script works or not, as it's not even executing it.

BTW, I just noticed... you should have a &quot;method&quot; in your form tag... eg:
Code:
<form action=&quot;/cgi/test.cgi&quot; method=&quot;post&quot;>
Possible form methods include &quot;post&quot; and &quot;get&quot;. Since your script is looking on the query string, you should probably use &quot;get&quot;, but &quot;post&quot; is the normal form submission method, as it can handle larger data. Use the CGI.pm module to handle CGI input. Sincerely,

Tom Anderson
Order amid Chaos, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top