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"); } ?> Quote 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"); } ?> Quote 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 Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/128266-solved-help-with-code/#findComment-664325 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.