ChrisML123 Posted October 13, 2008 Share Posted October 13, 2008 i am a complete newbie, making a very basic template get this error when i run the page. any ideas? Parse error: syntax error, unexpected T_ELSE in /home/saltandl/public_html/test/content.php on line 6 Code is below: thanks! <?php if (isset($_GET["title"])){ if (file_exists($_GET["title"].".php")) { include ($_GET["title"].".php");}} else {echo ("Wrong page homie!"); else {include ("home.php"); } ?> Link to comment https://forums.phpfreaks.com/topic/128266-solved-help-with-code/ Share on other sites More sharing options...
aebstract Posted October 13, 2008 Share Posted October 13, 2008 your else statements should have 'one' closing bracket in front of them: <?php if (isset($_GET["title"])){ if (file_exists($_GET["title"].".php")) { include ($_GET["title"].".php"); } else { echo ("Wrong page homie!"); } } else { include ("home.php"); } ?> Link to comment https://forums.phpfreaks.com/topic/128266-solved-help-with-code/#findComment-664305 Share on other sites More sharing options...
revraz Posted October 13, 2008 Share Posted October 13, 2008 You have two }} after your include. *too late Link to comment https://forums.phpfreaks.com/topic/128266-solved-help-with-code/#findComment-664308 Share on other sites More sharing options...
ChrisML123 Posted October 13, 2008 Author Share Posted October 13, 2008 brilliant. i know it was way below you, but we all start somewhere! Thanks! Link to comment https://forums.phpfreaks.com/topic/128266-solved-help-with-code/#findComment-664325 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.