Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 5th, 2005, 9:51 AM   #11
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I have a feeling /php5 doesn't even exist.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 5th, 2005, 10:58 AM   #12
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
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.
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Sep 6th, 2005, 7:44 AM   #13
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
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
Berto is offline   Reply With Quote
Old Sep 6th, 2005, 10:05 AM   #14
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
True. most servers are running php 4 right now
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:45 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC