httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten P. Gehrke" <Cars...@rollinghorse.com>
Subject Re: [users@httpd] CGI script executing twice
Date Mon, 15 Dec 2003 08:17:23 GMT
At 17:58 14-12-03, you wrote:
>Brian Dessent wrote:
> >
> > Chris W wrote:
> >
> > > I fixed my html as you suggested and it still does the same thing.  It
> > > has this behavior with IE, Netscape 7.1, and opera.  With Netscape 4.7 I
> > > get this. . .
> > >
> > >  "POST /cgi-bin/addToCart.pl HTTP/1.0" 200 6521
> > >  "GET /cgi-bin/? HTTP/1.0" 403 286
> >
> > If I were you I'd download and install Ethereal and get a packet capture
> > of the entire browser-server conversation.  Something is obviously wrong
> > here, but without a capture it's rather like looking for a needle in a
> > haystack, blindfolded.  THere are precompiled Ethereal binaries for
> > windows, it's really not terribly hard to do.  You might also try
> > Mozilla's "live headers" plug-in.  There are doubtless countless other
> > programs that can achieve the same effect, but Ethereal is the old
> > standby.
>
>
>This can't be that hard. . . there has to be something I'm missing
>here.  This happens on a redhat 6.2 machine with Apache, a win 2k
>machine with Apache 2 and a redhat 9.0 machine with apache 2.

Just for fun, I connected to your site with telnet and ran a conversation 
by hand.

First I retrieved your static page:
$ telnet cdw.homelinux.com 8086
Trying 68.12.125.52...
Connected to cdw.homelinux.com.
Escape character is '^]'.
GET /song2.html HTTP/1.1
Host: cdw.homelinux.com

HTTP/1.1 200 OK
Date: Mon, 15 Dec 2003 07:49:03 GMT
Server: Apache/2.0.48 (Win32)
Last-Modified: Mon, 15 Dec 2003 05:04:01 GMT
ETag: "7c43-12d-cd532731"
Accept-Ranges: bytes
Content-Length: 301
Content-Type: text/html; charset=ISO-8859-1

<html>
Buy the new CD for $11.00, Buy two or three!!
<FORM ACTION="/cgi-bin/addToCart.pl" METHOD=GET>
<INPUT TYPE="text" SIZE="4" NAME="qty" VALUE="1">
<INPUT TYPE="HIDDEN" NAME="price" VALUE="11">
<INPUT TYPE="HIDDEN" NAME="item" VALUE="CD2">
<input type="submit" value="Buy">
</form>
</html>Connection closed by foreign host.

I then connected again to invoke your script"
$ telnet cdw.homelinux.com 8086
Trying 68.12.125.52...
Connected to cdw.homelinux.com.
Escape character is '^]'.
GET /cgi-bin/addToCart.pl?qty=1&price=11&item=CD2&submit=Buy HTTP/1.1
Host: cdw.homelinux.com

(The server rewarded me with lengthy output.  Since I already tried to 
access your site with a browser, I knew what to expect.  I believe I got 
the same output my browser got, so I won't reproduce it here)

Now you should check you logs to see if the GET and POST entries are in 
there.  You should only see a GET entry.

BTW, I find it odd that the POST entry in your logs comes before the 
GET.  Your static HTML page states the form method to be GET, so that is 
what a browser would use.

HTH,
Carsten


--
Rolling Horse Ranch Technical Services                 Carsten P. Gehrke
          Custom software solutions using open source technology
http://tech.RollingHorse.com/                   Carsten@RollingHorse.com



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message