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

COOKIE MONSTER NOT PLAYING HELP!!!!!!

Status
Not open for further replies.
Just adding error from server


[Mon Dec 27 22:57:35 2004] [error] [client 127.0.0.1] Options ExecCGI is off in this directory: C:/Program Files/Apache Group/Apache2/htdocs/store_cookie.cgi, referer:
this is the error i get from my server

help MADAXE
 
Options ExecCGI is off in this directory"
You failed to specify the cgi-bin/ and options within your httpd.conf

Look for somthing like this in your httpd.conf
Code:
#
# This may also be "None", "All", or any combination of "Indexes",   
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#     
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#     
    Options Indexes FollowSymLinks MultiViews [b]ExecCGI[/b]

 
I found that option and added the last two options to it

MultiViews ExecCGI

it made a differance, i no longer get the original error i get a:-

The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

--------------------------------------------------------------------------------

Please try the following:

If you typed the page address in the Address bar, make sure that it is spelled correctly.

Open the localhost home page, and then look for links to the information you want.
Click the Back button to try another link.
Click Search to look for information on the Internet.



HTTP 404 - File not found
Internet Explorer

the code im using is as follows


Can anybody please help im not sure if i ahve moded my httpd.conf file correctly or not?



******************file 1***************
<html>
<head>
<title>Cookie Monster</title>
</head>
<body>
<h3>Who is your favorite Sesame Street character?</h3>
<form method="get" action="/store_cookie.cgi">
<p><input type="text" name="Monster"></p>
<p><input type="submit" value="Vote Now"></p>
</form>
</body>
</html>

******************file 2********************

#!/Perl/bin/perl
use strict;
use CGI;
use CGI::Cookie;

my $cgi = new CGI;

print
$cgi->header( -cookie => new CGI::Cookie(-name => 'Monster',
-value => $cgi->param('Monster'),
-expires => '+3d',
-domain => 'inconnu.isu.edu'
)
) .
$cgi->start_html('Cookie Monster Catcher') .
$cgi->h3("I'm sending your browser a cookie right now to: " .
$cgi->param('Monster')) .
$cgi->p('<a href="look_at_cookie.cgi">Click here to read your cookie</a>') .
$cgi->end_html();
exit (0);


******************file 3***************

#!/Perl/bin/perl
use strict;
use CGI;
my $cgi = new CGI;
print
$cgi->header() .
$cgi->start_html('Cookie Monster Reader') .
$cgi->h3("I see your cookie is: " . $cgi->cookie('Monster')) .
$cgi->p('<a href=" .
'Click here to return to the tutorial</a>') .
$cgi->end_html();
exit (0);
 
Na if i run the .cgi files individually they run however if i try to run the html programme as it should be run i see the html but when i select the vote now button it comes up with a bad page . i dont understand.

im not sure if my httpd.conf file is configured correctly

MadAxe
 
ok i found a bug in my code ...dumbass....however the last piece i still cant get to work where it reads the cookie back into the window, code piece three see above.

If anybody can help it would be appreciated


Madaxe
 
on the third piece where it says

I see your cookie is: "

it does not display the cookie info

any surgestions


MadAxe

 
Also.. do something like this
Code:
print
$cgi->header( -cookie => new CGI::Cookie(
                        -name           =>      'Monster',
                        -value          =>      $cgi->param('Monster'),
                        -expires        =>      '+3d',
                        -domain         =>      '[b].inconnu.isu.edu[/b]'
                        )
                ) .
$cgi->start_html('Cookie Monster Catcher') .
$cgi->h3("I'm sending your browser a cookie right now to: " .
$cgi->param('Monster')) .
$cgi->p('<a href="look_at_cookie.cgi">Click here to read your cookie</a>') .
$cgi->end_html();
exit (0);

 
i tried your code i gett he same result when i use the last piece i still get nothing, id there something wrong with Apache?

MadAxe
 
Apache is fine if you are receiving output.

Try this..
Code:
print
$cgi->header( -cookie => new CGI::Cookie(
                        -name           =>      'Monster',
                        -value          =>      $cgi->param('Monster'),
                        [b]-path           =>      '/',[/b]
                        -expires        =>      '+3d',
                        -domain         =>      '[b].inconnu.isu.edu[/b]',
                        [b]-secure         =>       0[/b]
                        )
                ) .
$cgi->start_html('Cookie Monster Catcher') .
$cgi->h3("I'm sending your browser a cookie right now to: " .
$cgi->param('Monster')) .
$cgi->p('<a href="look_at_cookie.cgi">Click here to read your cookie</a>') .
$cgi->end_html();
exit (0);

 
still no joy this is what i get:-

PAGE ONE

Who is your favorite Sesame Street character?
in text box = cookie monster
button = Vote now


PAGE TWO

url =
I'm sending your browser a cookie right now to: cookie monster
Click here to read your cookie

PAGE THREE

url =
I see your cookie is:
Click here to return to the tutorial


Still the same problem the info seems to be passed from page one into page two but no further?

MadAxe
 
this is probably a stupid question but how do i do that?

MadAxe
 
no there is nothing i already looked there i was not sure if the cookies were stored in the same place. I deleted them all then ran script nothing

MadAxe
 
The browser may not accept the cookie if it's connecting to 'localhost' and the cookie's domain is 'inconnu.isu.edu'. Try not setting the domain:
Code:
$cgi->header( -cookie => new CGI::Cookie(
                        -name           =>      'Monster',
                        -value          =>      $cgi->param('Monster'),
                        -expires        =>      '+3d'
                        )
                ) .

 
BINGO

THANKS ALOT VERY philote

MADAXE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top