![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I have a feeling /php5 doesn't even exist.
|
|
|
|
|
|
#12 |
|
Professional Programmer
|
You're running this on a web server, the / refers to the absolute path.
Let's say your site uses a LAMP Stack with Cpanel. Your public html files would be in /home/you/public_html/ So when you reference something in html, it looks for it at the domain root. www.whatever.com/whatever.jpg for example. But PHP, because it's server side, looks at the server. When you type in /php5/class.Demo.php it's looking at the root of the hard drive to find the php5 folder. If you type in /home/you/public_html/php5/class.Demo.php it'll work. But that's a pain in the ass. It's better to just reference it to where the file is. For example. Say your site structure is like this domain root (.com) --> index.php php5--> class.Demo.php Now, you want to include class.Demo.php in the index.php file. You can't start it with a / because it'll look at the hard drive. So you would do include('php5/class.Demo.php'); or require('php5/class.Demo.php'); I've given up most includes for requires now as they pretty much power my scripts and sites and it's pointless without them. |
|
|
|
|
|
#13 |
|
Programming Guru
![]() |
also run this
<?php phpinfo(); ?> and chek you have php5 running on the web server as i had a problem with classes then found out my webserver was running pre 5.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
|
|
#14 |
|
Professional Programmer
|
True. most servers are running php 4 right now
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|