in reply to Re^3: Testing for existence of cookies
in thread Testing for existence of cookies

Ok, It work one time and that was it. I change the line to look like this if (!defined($cgi->cookie('name'))) { $msgnew = "Welcome Back, $uname"; } else { &New_Acc; } I'm not getting a 500 internal server error any more, it just won't work. When it doesn't find the cookie name. It should run a subroutine called. &New_Acc; and well it still thinks theres a cookie there, even when I deleted the cookie from my browser. Thanks joe

Replies are listed 'Best First'.
Re^5: Testing for existence of cookies
by larryp (Deacon) on Jun 26, 2005 at 18:30 UTC

    You want to welcome the user back if the 'Name' cookie is not defined? Are you sure this is right? The logic in the code doesn't match what you say you want in the description.

    What's happening? You say you're not getting an error, but what are you getting? Where are you printing the message string?

    Larry

      At the beginning, Like I said, if I use if (!defined($cgi->cookie('name'))) I don't get any errors, It just doesn't work. when I tryed if (defined($cgi->cookie('name'))) I keep geting a 500 internal server error. The script won't run. I know that the ! means not defined. But thats not what I want. I want to is if one of 3 is defined and then do some thing. I have to make changes so I could get this script running, its just not running the way I want.
        The code you posted looks valid. You need to help others help you.

        If you have access to your server logs, please post the error.

        If not, add the following: use CGI::Carp 'fatalsToBrowser'; after the shebang but before any other lines in your script and post the error shown.

        You should probably read Troubleshooting Perl CGI scripts as well.