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

if else loop

Status
Not open for further replies.

thendal

Programmer
Aug 23, 2000
284
Hi all!

What wrong with this code ,

Its giving a error




if($k == 1)
{
$value="y";
if($value eq "y")
{
$selected1='selected';
}
else
{
$selected1='';
}
}
print $selected;

Its giving an error

unmatched right bracket at line 13,at end of line syntax error at line 13, near "}"
Execution aborted due to compilation errors

but when i look into the program I didn't see any syntax error over the code ,

Or we can't have if else loop inside a if loop .( i don't think so)

please help me to get rid of this error ,

:)
Thendal


 
It works fine on my machine. Perhaps it is not that part of the code that is giving the error but another part.

-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
ditto on vikter's suggestion that the error lies else where. If you are using an editor that will match brackets for you, just start working your way backwards up through your code. If your editor won't do that, .... oh well. Gotta' do the hard way....


keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top