Far Cry Posted July 13, 2010 Share Posted July 13, 2010 While trying to run this file... <?php include'_class/cms_class.php'; $obj = new modernCMS(); $obj->host ='localhost'; $obj->username =''; $obj->password =''; $obj->db =''; $obj->connect(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html"; "charset=utf-8" /> <title></title> </head> <body> <?php if(isset($_GET['id'])); $obj->get_content($_GET['id']); else: $obj->get_content(); endif; ?> </body> </html> I get this error... Parse error: syntax error, unexpected T_ELSE in /home/latestne/public_html/tests What am I doing wrong? Thanks in advance... Quote Link to comment Share on other sites More sharing options...
trq Posted July 13, 2010 Share Posted July 13, 2010 if(isset($_GET['id'])); should be.... if(isset($_GET['id'])): Or even better. Stick to braces {} like the rest of the php world. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.