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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI and using in html code a questionmark "some.cgi?URL=etc"

Status
Not open for further replies.

maxit

Technical User
Mar 8, 2001
35
US
I get an error of file not found when I use a cgi that in the html page that calls it
like

a href="
I get an the error of file not found. file permissions checked and rechecked along
with permissions on directories. also files do exist. I tried this on two seperate web
server boxes and come back with same error. I'm running other cgi's from same
place with no problems....its the quesitonmark (?) that is giving me the fits. script is
perl and made sure script has right perl path all the normal things I've checked and
rechecked.

This is causing alot of hair loss. Anyone have an idea?

Maxit
 
I do this trick all the time. The '?' is no problem. Unfortunately, I have no idea what may be the problem. It must be something simple. File name upper/lower case? Typo? If other cgi apps are working, then it has to be something about the way you are building the link. How about post the lines of code you are using to build the link?


keep the rudder amid ship and beware the odd typo
 
Thanks for your reply,

I have tried other cgi's and have the same problem when a ? is used. I really think
it possibly might be the apache httpd.conf config somehow that limits the ? . But anyway here is a ton if info whats going on.
This cgi is someone elses script that was freely available which can be found below
to review the actual cgi perl code. Below is my setup configs and errors I'm seeing.
Please note this is on redhat apache ssi web server which I have a feeling is holding back some uri excape unexcape stuff which is a wild guess on my part.

You can find the script here:
------
Command line check... i have another cgi in same directory that works ok
so web server knows its an enabled CGI directory to run your CGI from.
-------
root search# perl ./linkjump.cgi
Content-type: text/html
<html>
<head>
<title>CGI Error</title>
</head>
<body>
<h1>CGI Error</h1>
<h3>Script was called with unsupported REQUEST_METHOD.</h3>
</body>
</html>

root search# perl ./linkjump.cgi?URL=http://www.nitroblast.com
Can't open perl script &quot;./linkjump.cgi?URL=http://www.nitroblast.com&quot;:
No such file or directory

Above is understandable on command line why it can't be found but also thought perl
would be smart enough to pickup the ? in the command line.
-----------
Logs show this when running browser on link
-----------
[Wed Mar 7 15:23:17 2001] [error] (2)No such file or directory: exec of
/home/cuban8/rcezine/search/linkjump.cgi failed
[Wed Mar 7 15:23:17 2001] [error] [client 216.127.155.109] Premature
end of script headers: /home/cuban8/rcezine/search/linkjump.cgi
-----------
inside of linkjump.txt
-----------
2;
##### This is it, logfile that you may want to analise later... ####
$logfile = '/home/cuban8/rcezine/search/linkjump.txt';
##### Your Site's homepage URL #######
$title_url = '##### URL for the header HTML file ########
$header_url = '----------
Directory for working files ls -l show
--------
ls -l of /home/cuban8/rcezine/search/
drwxr-xr-x 2 cuban8 cuban8 4096 Mar 7 15:35 search
-rwxr-xr-x 1 cuban8 cuban8 3076 Mar 7 15:35 linkjump.cgi
-rw-rw-rw- 1 cuban8 cuban8 322 Mar 7 15:38 linkjump.txt

ls -l of /home/cuban8/rcezine/
drwxr-xr-x 10 cuban8 cuban8 4096 Mar 7 14:44 rcezine
-rw-r--r-- 1 cuban8 cuban8 1584 Mar 7 14:44 welcomeback.html
-----------
Link within the html page to run this script the line for <a href=> is
-----------
<a href=&quot;/linkjump.cgi?URL=http://www.nitroblast.com&quot;>
<img src=&quot;../banners/nitroban.gif&quot;></a>

I sure could use some help on this you can email me direct at maxit@rcwing.com
The link on the above page though it does work is still in place to peek at from your
end.

Thank YOU!
Maxit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top