Syntax Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
KyleVan
Forum Newbie
Posts: 1
Joined: Sun Jul 10, 2011 11:46 pm

Syntax Error

Post by KyleVan »

I am working on a small controller file. I am pretty new to php and I know the code is basic and pretty simple for a php controller file.
I am getting a syntax error and I cant figure out why.. here is the code.

Code: Select all

<?php
//check for cookies and open session
include ('affilliate.inc.php');
//controller info
if(isset($_GET['goto'])
{
    $goto=$_GET['goto'];
    switch($goto)
    {
    case ('howworks'):
        include('pages/howworks.html.php');
        break;
    case ('offers'):
        include('pages/offers.html.php');
        break;
    case ('contact'):
        include('pages/contact.html.php');
        break;
    default:
        include('pages/error.html.php');
    }
//SYNTAX ERROR HERE
}
?>
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Syntax Error

Post by Weirdan »

You missed closing bracket for the if condition.
Post Reply