You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chris W <ch...@cox.net> on 2003/12/14 23:42:14 UTC

[users@httpd] CGI script executing twice

I have been having problems with my scripts executing twice so I looked
at the log file and saw this.

 "POST /cgi-bin/addToCart.pl HTTP/1.1" 200 6473
 "GET /cgi-bin/addToCart.pl? HTTP/1.1" 200 6417

The first time this script gets values from a form post and works
correctly, the second time it gets no values and executes a second time,
is there a way to stop this?  And why is this happening?  BTW it doesn't
happen if the user is using an old version of Netscape. 4.7.


-- 
Chris W

"They that can give up essential liberty 
to obtain a little temporary safety 
deserve neither liberty nor safety." 
-- Benjamin Franklin, 1759 Historical Review of Pennsylvania

---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by Brian Dessent <br...@dessent.net>.
Chris W wrote:

> > 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.

But that's kind of my point.  :-)  This is most likely something dumb
and stupid, but looking at log files, guessing about configurations, and
trying various permutations of html code is the slowest way possible to
solve it.  I'd bet $1 that if you saw exactly what was going on you'd
know exactly why the browser first tries a POST and then a GET.  And
doing this is very easy with Ethereal.

Brian

---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by Marty Landman <ML...@face2interface.com>.
At 10:25 AM 12/15/2003, you wrote:
>Maybe, the user that clicks the send button in your form, makes a double
>click very fast. This causes that the browser send 2 requests.

Both post or get depending on the request type coded though... he's getting 
one post and one get and it's browser dependent.

Marty Landman   Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml


---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by Luis Fernando Gallegos Valencia <lf...@pichincha.com>.
Maybe, the user that clicks the send button in your form, makes a double
click very fast. This causes that the browser send 2 requests.
You can make it, just double click very fast.

	Luis


On Mon, 2003-12-15 at 03:17, Carsten P. Gehrke wrote:
> 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
> 
> 


---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by "Carsten P. Gehrke" <Ca...@rollinghorse.com>.
At 09:51 15-12-03, you wrote:
>"Carsten P. Gehrke" wrote:
>
> > Argh!  When I saw the result page (after selecting 1 CD from song2.html), I
> > looked through the JavaScript for an "onLoad" action, or something else
> > that might cause the page to be reloaded.  You must have removed the extra
> > code just before I looked...
> >
> > Anyway, telnet makes a nice tool for tetsing Web servers (and
> > scripts).  You always know exactly what is being sent to the server, and
> > what the server sends back.
> >
>
>I need to try that. . . Anyway I didn't change anything in the Java
>Script, all I did was comment out the part of my perl script that read
>the templet containing the java script to test and that solved the
>problem.  However I still haven't figured out what it is in the Java
>Script that is causing the reload (I haven't studied java script yet,
>someone gave that to me) In further testing just loading that templet
>file by typing the URL http://cdw.homelinux.com:8086/Cart.html in the
>browser I get two gets one for just cart.html and one for cart.html?
>why the ? is added to the second get I have no idea.  But I think it is
>pretty clear that it is not a server side problem. . . I guess I need to
>send the info to a java script list now.  Thanks for everyone's help
>
>--
>Chris W

Actually, I don't think it's a JavaScript problem (see my previous post, 
which crossed yours).  Try accessing the template file with a browser that 
has no JavaScript (like Lynx) or has it turned off (or maybe use telnet), 
and look at the logs.  That way you _know_ the JavaScript isn't causing the 
problem.  Maybe it's a funky Apache configuration...


--
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


[users@httpd] Using PKI to Authenticate Users

Posted by Thomas George <tg...@ibaset.com>.
As anyone seen of heard of solution or configuration directive that will
allow me to automatically authenticate valid users based on their PKI
certificate..?

Any suggestions would be appreciated..!

Thanks,

Thomas


---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by Chris W <ch...@cox.net>.
"Carsten P. Gehrke" wrote:

> Argh!  When I saw the result page (after selecting 1 CD from song2.html), I
> looked through the JavaScript for an "onLoad" action, or something else
> that might cause the page to be reloaded.  You must have removed the extra
> code just before I looked...
> 
> Anyway, telnet makes a nice tool for tetsing Web servers (and
> scripts).  You always know exactly what is being sent to the server, and
> what the server sends back.
> 

I need to try that. . . Anyway I didn't change anything in the Java
Script, all I did was comment out the part of my perl script that read
the templet containing the java script to test and that solved the
problem.  However I still haven't figured out what it is in the Java
Script that is causing the reload (I haven't studied java script yet,
someone gave that to me) In further testing just loading that templet
file by typing the URL http://cdw.homelinux.com:8086/Cart.html in the
browser I get two gets one for just cart.html and one for cart.html? 
why the ? is added to the second get I have no idea.  But I think it is
pretty clear that it is not a server side problem. . . I guess I need to
send the info to a java script list now.  Thanks for everyone's help

-- 
Chris W

"They that can give up essential liberty 
to obtain a little temporary safety 
deserve neither liberty nor safety." 
-- Benjamin Franklin, 1759 Historical Review of Pennsylvania

---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by "Carsten P. Gehrke" <Ca...@rollinghorse.com>.
At 05:34 15-12-03, you wrote:
>"Carsten P. Gehrke" wrote:
>
> > 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.
>
>The reason you saw the get is I changed the form from POST to GET to see
>what would happen.  All it did was give me 2 Gets, but then I was
>thinking about it and figured started thinking about the templet file my
>script was reading and printing around it's dynamic output.  There is a
>lot of java script in there and I was wondering if that was making it
>reload, so I commented out the parts that read in the templet with all
>the java script and low and behold problem solved :)  Now all I need to
>do is figure out why the java script is making my script reload and how
>to stop it.
>
>Here is a link to just the templet file with out any of the dynamic data
>from the script in case anyone cares to look at java script.
>
>http://cdw.homelinux.com:8086/Cart.html
>
>--
>Chris Woodhouse

Argh!  When I saw the result page (after selecting 1 CD from song2.html), I 
looked through the JavaScript for an "onLoad" action, or something else 
that might cause the page to be reloaded.  You must have removed the extra 
code just before I looked...

Anyway, telnet makes a nice tool for tetsing Web servers (and 
scripts).  You always know exactly what is being sent to the server, and 
what the server sends back.


--
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


Re: [users@httpd] CGI script executing twice

Posted by Chris W <ch...@cox.net>.
"Carsten P. Gehrke" wrote:
 
> OK, now I'm confused.  What you are saying is that the above file
> (Cart.html) is what your addToCart.pl script reads in, and you changed the
> Perl script to prevent that.  Now you do not see the extra GET in your
> logs, but your output doesn't have all the fancy stuff around it,
> right?  

Right.

> If you didn't change the JavaScript, then it still doesn't make
> sense.  I see nothing in the existing JavaScript that would cause the page
> to reload.  What does your Perl script look like?

Well I don't think that is the problem since I get the two entries in
the log by just loading the templet my script was reading as an html
file.  But my script can be read here

http://cdw.homelinux.com:8086/addToCart.pl

> 
> BTW, when I ran my telnet tests your script still produced the template
> around the dynamic output, so you must not have made the changes at that
> time.  Could you check the log files to see if the were two GET entries at
> the time I was testing (Mon, 15 Dec 2003 07:49:03 GMT)?  I only sent one
> GET request, so the server only got one from me.  If there are two, then
> most likely the browsers aren't at fault.

Here are the relevant entries around that time period, I removed a bunch
of Gets for gif file in my images dir.

192.75.23.73 - - [15/Dec/2003:07:46:58 -0600] "GET /Cart.html HTTP/1.0"
200 5408
192.75.23.73 - - [15/Dec/2003:07:46:59 -0600] "GET /? HTTP/1.0" 200 5423
192.75.23.73 - - [15/Dec/2003:07:47:00 -0600] "GET /Cart.html? HTTP/1.0"
200 5408
146.109.240.107 - - [15/Dec/2003:07:49:37 -0600] "GET /Cart.html
HTTP/1.1" 200 5408
146.109.240.107 - - [15/Dec/2003:07:49:54 -0600] "GET /Cart.html?
HTTP/1.1" 200 5408
195.129.18.251 - - [15/Dec/2003:07:50:32 -0600] "GET /Cart.html
HTTP/1.1" 200 5408
195.129.18.251 - - [15/Dec/2003:07:50:35 -0600] "GET /Cart.html?
HTTP/1.1" 200 5408
195.129.18.251 - - [15/Dec/2003:07:50:43 -0600] "GET /Cart.html?
HTTP/1.1" 206 3360
66.26.252.107 - - [15/Dec/2003:08:05:07 -0600] "GET /Cart.html HTTP/1.1"
200 5408
66.26.252.107 - - [15/Dec/2003:08:05:08 -0600] "GET /Cart.html?
HTTP/1.1" 200 5408
64.30.129.203 - - [15/Dec/2003:08:13:50 -0600] "GET /song2.html
HTTP/1.1" 200 302


> 
> BTWA, your script seems to output a superfluous "Content-Type" header.


I just noticed that myself too, and fixed it.

-- 
Chris Woodhouse
3147 SW 127th St.
Oklahoma City, OK 73170
405-691-5206
N35° 20.492' 
W97° 34.342'

"They that can give up essential liberty 
to obtain a little temporary safety 
deserve neither liberty nor safety." 
-- Benjamin Franklin, 1759 Historical Review of Pennsylvania

---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by "Carsten P. Gehrke" <Ca...@rollinghorse.com>.
At 05:34 15-12-03, you wrote:
>"Carsten P. Gehrke" wrote:
>
> > 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.
>
>The reason you saw the get is I changed the form from POST to GET to see
>what would happen.  All it did was give me 2 Gets, but then I was
>thinking about it and figured started thinking about the templet file my
>script was reading and printing around it's dynamic output.  There is a
>lot of java script in there and I was wondering if that was making it
>reload, so I commented out the parts that read in the templet with all
>the java script and low and behold problem solved :)  Now all I need to
>do is figure out why the java script is making my script reload and how
>to stop it.
>
>Here is a link to just the templet file with out any of the dynamic data
>from the script in case anyone cares to look at java script.
>
>http://cdw.homelinux.com:8086/Cart.html
>
>--
>Chris Woodhouse

OK, now I'm confused.  What you are saying is that the above file 
(Cart.html) is what your addToCart.pl script reads in, and you changed the 
Perl script to prevent that.  Now you do not see the extra GET in your 
logs, but your output doesn't have all the fancy stuff around it, 
right?  If you didn't change the JavaScript, then it still doesn't make 
sense.  I see nothing in the existing JavaScript that would cause the page 
to reload.  What does your Perl script look like?

BTW, when I ran my telnet tests your script still produced the template 
around the dynamic output, so you must not have made the changes at that 
time.  Could you check the log files to see if the were two GET entries at 
the time I was testing (Mon, 15 Dec 2003 07:49:03 GMT)?  I only sent one 
GET request, so the server only got one from me.  If there are two, then 
most likely the browsers aren't at fault.

BTWA, your script seems to output a superfluous "Content-Type" header.


--
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


Re: [users@httpd] CGI script executing twice

Posted by Chris W <ch...@cox.net>.
"Carsten P. Gehrke" wrote:
 
> 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.

The reason you saw the get is I changed the form from POST to GET to see
what would happen.  All it did was give me 2 Gets, but then I was
thinking about it and figured started thinking about the templet file my
script was reading and printing around it's dynamic output.  There is a
lot of java script in there and I was wondering if that was making it
reload, so I commented out the parts that read in the templet with all
the java script and low and behold problem solved :)  Now all I need to
do is figure out why the java script is making my script reload and how
to stop it.

Here is a link to just the templet file with out any of the dynamic data
from the script in case anyone cares to look at java script.

http://cdw.homelinux.com:8086/Cart.html

-- 
Chris Woodhouse
3147 SW 127th St.
Oklahoma City, OK 73170
405-691-5206
N35° 20.492' 
W97° 34.342'

"They that can give up essential liberty 
to obtain a little temporary safety 
deserve neither liberty nor safety." 
-- Benjamin Franklin, 1759 Historical Review of Pennsylvania

---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by "Carsten P. Gehrke" <Ca...@rollinghorse.com>.
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


Re: [users@httpd] CGI script executing twice

Posted by Chris W <ch...@cox.net>.
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.


-- 
Chris W

---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by Brian Dessent <br...@dessent.net>.
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.

Brian

---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by Chris W <ch...@cox.net>.
Marty Landman wrote:
> 
> At 06:25 PM 12/14/2003, you wrote:
> 
> >The form that contains the post that executes that perl script is here
> >on my testing server
> >
> >http://cdw.homelinux.com:8086/song2.html
> 
> Not much to it as you say. Does it behave the same way if you close the
> form in the proper place e.g.
> 
> </form>
> 
> before the </html>?
> 
> Also you mentioned something about this being browser specific? Have you
> tried it on IE? Maybe it's the browser rather than the server causing the
> multiple requests.

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


-- 
Chris W

"They that can give up essential liberty 
to obtain a little temporary safety 
deserve neither liberty nor safety." 
-- Benjamin Franklin, 1759 Historical Review of Pennsylvania

---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by Marty Landman <ML...@face2interface.com>.
At 06:25 PM 12/14/2003, you wrote:

>The form that contains the post that executes that perl script is here
>on my testing server
>
>http://cdw.homelinux.com:8086/song2.html

Not much to it as you say. Does it behave the same way if you close the 
form in the proper place e.g.

</form>

before the </html>?

Also you mentioned something about this being browser specific? Have you 
tried it on IE? Maybe it's the browser rather than the server causing the 
multiple requests.

Marty Landman   Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml


---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by BAO RuiXian <ru...@pp.inet.fi>.
Chris W wrote:

>Marty Landman wrote:
>  
>
>>At 05:42 PM 12/14/2003, you wrote:
>>
>>    
>>
>>> "POST /cgi-bin/addToCart.pl HTTP/1.1" 200 6473
>>> "GET /cgi-bin/addToCart.pl? HTTP/1.1" 200 6417
>>>
>>>The first time this script gets values from a form post and works
>>>correctly, the second time it gets no values and executes a second time
>>>      
>>>
>>Can you post the URL? This sounds like something in the HTML coding gone awry.
>>    
>>
>
>The form that contains the post that executes that perl script is here
>on my testing server
>
>http://cdw.homelinux.com:8086/song2.html
>
>  
>
I check your source code of song2.html. I think you should change the 
value of METHOD from GET to POST, because you are submitting the form 
data to the script addToCart.pl, not calling the script from a URL. In 
the current situation, the Apache server is somehow confused.

Best

Bao

>All that is in there now is the minimum form to get the thing to work
>for testing so it is only 8 lines of html.
>
>  
>


---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by Chris W <ch...@cox.net>.
Marty Landman wrote:
> 
> At 05:42 PM 12/14/2003, you wrote:
> 
> >  "POST /cgi-bin/addToCart.pl HTTP/1.1" 200 6473
> >  "GET /cgi-bin/addToCart.pl? HTTP/1.1" 200 6417
> >
> >The first time this script gets values from a form post and works
> >correctly, the second time it gets no values and executes a second time
> 
> Can you post the URL? This sounds like something in the HTML coding gone awry.

The form that contains the post that executes that perl script is here
on my testing server

http://cdw.homelinux.com:8086/song2.html

All that is in there now is the minimum form to get the thing to work
for testing so it is only 8 lines of html.

-- 
Chris W

"They that can give up essential liberty 
to obtain a little temporary safety 
deserve neither liberty nor safety." 
-- Benjamin Franklin, 1759 Historical Review of Pennsylvania

---------------------------------------------------------------------
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


Re: [users@httpd] CGI script executing twice

Posted by Marty Landman <ML...@face2interface.com>.
At 05:42 PM 12/14/2003, you wrote:

>  "POST /cgi-bin/addToCart.pl HTTP/1.1" 200 6473
>  "GET /cgi-bin/addToCart.pl? HTTP/1.1" 200 6417
>
>The first time this script gets values from a form post and works
>correctly, the second time it gets no values and executes a second time

Can you post the URL? This sounds like something in the HTML coding gone awry.


Marty Landman   Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml


---------------------------------------------------------------------
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