Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 3rd, 2014, 09:46 AM
Registered User
 
Join Date: Feb 2014
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Load classes

Hy i have problem with loading classes in localhost work just fine but when i uploaded to server a get error that can't find class. I use 000webhost.

in index page i put this code

<?php
//load classes
require_once 'inc/autoload.php';
//instatiate Core class
$core = new Core();
$core->run();
?>
in autoload.php which is in folder inc i put these code
<?php
function __autoload($class_name)
{
try
{
$class_file = 'classes/'. strtolower($class_name).'.php';
if(is_file($class_file))
{
require_once $class_file;
}
else
{
throw new Exception("Unable to load class $class_name in file $class_file.");
}
}
catch (Exception $e)
{
$e->getMessage();
}
}
?>

where the problem do i have on server to include some other path





Similar Threads
Thread Thread Starter Forum Replies Last Post
[C# net 4] Load page please wait (not updating but page load) cms9651 ASP.NET 4 General Discussion 0 May 4th, 2013 05:35 PM
Load Repeater (Data)content on the page load? master777 ASP.NET 4 General Discussion 8 April 11th, 2013 08:21 PM
Load Repeater (Data)content on page load? master777 BOOK: Beginning ASP.NET 4 : in C# and VB 1 April 10th, 2013 02:32 AM
Classes dotnetDeveloper ASP.NET 3.5 Basics 5 March 4th, 2009 05:17 PM
Classes digby_dog VB.NET 2002/2003 Basics 1 May 2nd, 2005 09:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.