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... Link to comment https://forums.phpfreaks.com/topic/207660-parse-error-syntax-error-unexpected-t_else-in-homelatestnepublic_htmltests/ 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. Link to comment https://forums.phpfreaks.com/topic/207660-parse-error-syntax-error-unexpected-t_else-in-homelatestnepublic_htmltests/#findComment-1085579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.