spl_autoload_register("auto");
function auto($class_name){
include_once($class_name.'.php');
}
$url=new clean_url($_SERVER["REQUEST_URI"]);
$c=1;
//echo $url->segment(2);
if(!$url->segment($c)){
//include homepage
}
else{
switch($url->segment($c)){
case 'events':
include_once($_SERVER['DOCUMENT_ROOT'].'/events.php');
break;
default:
include_once('404.php');
break;
}
}
?>
in the events.php file
<?php
if($url->segment($c+1)){
$e=$url->segment($c+1);
switch ($e) {
case 'ecstasy':
include_once($_SERVER['DOCUMENT_ROOT'].'temps/ecstasy.php');
break;
default:
# code...
break;
}
}
while testing the code on localhost(xampp) the code is working and the req. pages are being included.But when trying on the big rock server the output is coming as
Fatal error: Call to a member function segment() on a non-object in /home/public_html/events.php on line 2
What can be the reason for this difference and how can i make it work on the bigrock servers?