On approximately 2/20/2007 6:45 AM, came the following
characters from
the keyboard of Jerry Kassebaum:
> Friends,
>
> I may have to include more code, but maybe this will be
enough for you
> experts to say, "Oh, yeah, there's your
problem!"
>
> When a player goes to my website, biblescramble.com,
and attempts to play
> the first level of my game, the output is
"Location:
> ht
tp://biblescramble.com/biblescramble7.html" on the
first attempt. At that
> point the lines
>
> print <<EOD;
> Set-Cookie: guest=$lastCookie; expires=Wed, 29-Dec-2022
00:00:00 GMT;
>
>
> EOD
>
> set a cookie. Then if the player goes back and tries
again, or hits the
> refresh button, the game works. This is not optimal.
>
> How can I get it to skip that "Location:
> ht
tp://biblescramble.com/biblescramble7.html"
step???
>
> If you need more details, let me know. If you go to
biblescramble.com an
> play the first game you'll see what I mean. Try twice
and the game will
> work. Delete my cookie from your machine and it will
goof up again.
>
> Thanks!
>
> Jerry Kassebaum
>
> P.S.
>
> The last few lines of the cgi program follow:
>
>
> print "Location: http://b
iblescramble.com/biblescramble7.htmlnn";
>
> # BOTH returns on the end are vital! One won't do ya!
>
>
>
> exit 0;
>
> Why would the process of setting a cookie cause that
line to literally print
> to the screen, when not setting a cookie lets it do
what it says???
>
So it sounds to me like you are probably trying to print
HTTP headers
from your cgi, but the headers have already been printed...
The "BOTH
returns" comment makes it sound like the Location:
header being printed
by the line you show is intended to be the last header in
the group of
HTTP headers produced, the signal of where HTTP headers end
in a stream
from the web server is a blank line (the 2nd return
generates one).
So if your Location: print happens after some other piece of
code
already ended the HTTP headers, then it is too late. You
need to figure
out where the headers are being generated, and include the
Location:
header before that, or as part of that.
--
Glenn -- http://nevcal.com/
===========================
A protocol is complete when there is nothing left to
remove.
-- Stuart Cheshire, Apple Computer, regarding Zero
Configuration Networking
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|