Where in that example you provided would you print the login form to set the possible cookies? I see you are doing pretty much two things: 1) printing the administrative page and 2) setting the cookie. But the cookie has to come from a form somewhere.
I would really like to thank you for making the rest of my programing days more than a million times easier to manage and debug. I looked over your code countless times and have taken to heart how you layout your script.
For example, I always wrote things like:
if ($pass eq $admin pass) {
if (defineded $this) {
}
Which got really confusing having the trailing { on the end of the line. This made it so much more difficult to find which brackets went with which and caused so many 'missing right curly bracket' warnings in the past.
Your method, which I'm using from now on:
if ($pass eq $adminpass)
{
#print do everything here
if (defined this)
{
#other things would go here
} #nice closing bracket, you can see where they line up
} #still matches the first bracket since it doesn't get attached t
+o the end of the line
If nothing else, thank you for displaying that code. It really is much better than what I've been doing and will save loads of time in each script that I write.
"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"
sulfericacid
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.