Jump to content

[SOLVED] help with code


ChrisML123

Recommended Posts

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

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"); }
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.