On 23 Nov 2001, at 18:33, Andre` Niel Cameron wrote:
> Ok, I have taken most suggestions and ideas and so far The script
> works, can set get and read cookies but I can NOT get this thing to
> check if there is a cookie and do somethingbased on the results:( It
> ALWAYS thinks there is a cookie. BTW pages.pl is just where I stuck
> all the HTML pages there is nothing important in there it's all
> standard HTML. Can someone take a crack at this please? Thanks
> ALOT!:)
>
> As always you can see it in action at http://a.axxs.net
....snip...
Below you (implicitly) create the key 'PlayerData' in the hash
%cookie! This line brings the key 'PlayerData' in existence, even if
Get_cookie() returned undef or ''. It would even create %cookie
itself...
> $cookie{'PlayerData'}= Get_Cookie;
And now you test if this key exists, which makes no sense because you
created it one line above...it will always evaluate to true.
> if (exists($cookie{'PlayerData'}))
....snip...
Try
if ($cookie{'PlayerData'}) { # just check if $cookie{'PlayerData'}
contains a true value
&Main_Frames_Page;
} else {
&login_page;
}
Read the perl core docs about existence, truth, and definedness
.... (and use strict, BTW)
Bodo
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]