Re: Whats wrong with my code?

From: Date: Tue, 16 Sep 2003 21:21:45 +0000
Subject: Re: Whats wrong with my code?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-162788@lists.php.net to get a copy of this message
Hi Stevie D Peele, you wrote:
Can someone spot what Is wrong with my code? Please read your code carefully and check the
writing of your variable $include! Sometimes you write $includes instead... It has to have the same name everywhere, PHP can't guess what you want ;-) What is the certain error message? And yes: if the file doesn't exists that should be included PHP will not be happy about it. PHP can't also guess what code is in the file you wanna include ;-) Regards, Matthias
<?php $page = $_GET['id']; switch ($page) {
    case "home":
        $include = "/includes/index.html";
    break;
    case "arts":
$include = "/includes/arts.html";
    break;
    case "aaexpert":
$include = "/includes/aaexpert.html";
    break;
    case "career":
$include = "/includes/career.html";
    break;
    case "comics":
$include = "/includes/comics.html";
    break;
    case "graphics":
$include = "/includes/graphics.html";
    break;
    case "computers":
$include = "includes/computers.html";
    break;
    case "consumers":
$include = "/includes/consumer.html";
    break;
    case "dailies":
$include = "/includes/dailies.html";
    break;
    case "forums":
$include = "/includes/forums.html";
    break;
    case "downloads":
$include = "/includes/downloads.html";
    break;
    case "editors":
$include = "/includes/editors.html";
    break;
    case "educational":
$include = "/includes/educational.html";
    break;
    case "electronics":
$include = "/includes/electronics.html";
    break;
    case "entertainment":
$include = "/includes/entertainment.html";
    break;
    case "shopping":
$include = "/includes/shopping.html";
    break;
    case "free":
$include = "/includes/freetime.html";
    break;
    case "government":
$include = "/includes/government.html";
    break;
    case "governments":
$includes = "/includes/governments.html";
    break;
    case "healthnews":
$includes = "/includes/healthnews.html";
    break;
    case "homegarden":
$includes = "/includes/homegarden.html";
    break;
    case "homework":
$includes = "/includes/homework.html";
    break;
    case "stuffworks":
$includes = "/includes/hsworks.html";
    break;
    case "inthenews":
$includes = "/includes/inthenews.html";
    break;
    case "infokiosk":
$includes = "/includes/kiosk.html";
    break;
    case "knowledge":
$includes = "/includes/builder.html";
    break;
    case "money":
$includes = "/includes/money.html";
    break;
    case "yahoo":
$includes = "/includes/yahoo.html";
    break;
    case "museums":
$includes = "/includes/museums.html";
    break;
    case "othernews":
$includes = "/includes/othernews.html";
    break;
    case "pictures":
$includes = "/includes/pictures.html";
    break;
    case "politics":
$includes = "includes/politics.html";
    break;
    case "quotations":
        $includes = "/includes/quotes.html";
    break;
    case "recreation":
$includes = "/includes/recreation.html";
    break;
    case "reference":
$includes = "/includes/reference.html";
    break;
    case "reviews":
$includes = "/includes/reviews.html";
    break;
    case "search":
$includes = "/includes/search.html";
    break;
    case "society":
$include = "/includes/society.html";
    break;
    case "sports":
$include = "/includes/sportsnews.html";
    break;
    case "studyhelp":
$include = "/includes/study.html";
    break;
    case "travel":
$include = "/includes/travel.html";
    break;
    case "USA":
$includes = "/includes/usa.html";
    break;
    case "USNews":
$includes = "includes/usnews.html";
    break;
    case "weather":
$includes = "/includes/weather.html";
    break;
    case "webmaster":
        $includes = "/includes/webmaster.html";
    break;
    case "goodbad":
$includes = "/includes/goodbad.html";
    break;
    case "world":
$includes = "/includes/world.html";
    break;    }
include ($include) ?> It says Line 195 which is the ?> Would it matter I don't have all of these files (i.e. /includes/world.html) were uploaded yet? Thanks, Stevie


« previous php.general (#162788) next »