I often have trouble with nested if/else statements as well and sometimes they can be a bugger to fix. But it looks like you're only missing two }'s.
You're not closing your first and your second IF, that's where the problems occur. So all I did was added a closed bracket after the first and second ELSE.
Please see the script below.
if (param())
{
my $name = param("name");
my $email = param("email");
my $phone = param("phone");
my $url = param("url");
my $requests = param("requests");
if ($name ne "")
{
if ($email ne "")
{
if ($requests ne "")
{
print "very good!";
}
else
{
print "please leave a message";
} }
else
{
print "please enter your email";
} }
else
{
print "please enter your name";
}
}
"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.