• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

why is this not working?

dawizman

New Member
in my page (rm2k.php)this is the only php script I have:
PHP:
<?php
if ($page == "1")
{include ('./rm2k/main.php');}
elseif ($page == "2")
{include ('./rm2k/games.php');}
elseif ($page == "3")
{include ('./rm2k/tut.php');}
elseif ($page == "4")
{include ('./rm2k/prog.php');}
elseif ($page == "5")
{INCLUDE ('./rm2k/gfx.php');}
elseif ($page == "6")
{include ('./rm2k/music.php');}
?>

And when, for instance I click on a link that looks like: <a href="rm2k.php?page=1>link</a> the file (main.php) does not show up. what am I doiing wrong?
 
Try this code, it might work:
Code:
<?php
if ($page == "1") {
include "(./rm2k/main.php)";
} elseif ($page == "2") {
include "(./rm2k/games.php)";
} elseif ($page == "3") {
include "(./rm2k/tut.php)";
} elseif ($page == "4") {
include "(./rm2k/prog.php)";
} elseif ($page == "5") {
include "(./rm2k/gfx.php)";
} elseif ($page == "6") {
include "(./rm2k/music.php)";
} else {
include "(./rm2k/main.php)";
}
?>
 
PHP:
<?
switch($page){
case 1:
include "(./rm2k/games.php)";
break;
case 2:
include "(./rm2k/tut.php)";
break;
case 3:
include "(./rm2k/prog.php)";
break;
case 4:
include "(./rm2k/gfx.php)";
break;
case 5:
include "(./rm2k/music.php)";
break;
default:
include "(./rm2k/main.php)";
}
?>
 
sorry i was so ttired last night i didnt see that u did this:
include"(bah)";
instead of
include('blah');
 
Back
Top