I am getting include () problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ly_thai_binh
Forum Newbie
Posts: 3
Joined: Tue May 07, 2002 2:31 am
Location: Vietnam
Contact:

I am getting include () problems

Post by ly_thai_binh »

Hello There,

I am getting the problem in sending mail in PHP 4. Please read my following words:

I am using the class of "class.html.mime.mail.inc" for sending mail with attachements. The errors I got as follows:
"
Warning: Failed opening 'class.html.mime.mail.inc' for inclusion (include_path='') in c:inetpubwwwrootphpNewsend.php on line 24

Fatal error: Cannot instantiate non-existent class: html_mime_mail in c:inetpubwwwrootphpNewsend.php on line 45. "

Basically, I have adjusted the path in the file of php.ini in WindowNT to:
1. Include_path=
or
2. include_path="C:PHPclass.html.mime.mail.inc"
After testing some times, I got the same errors mentioned above.
Please help me or show me the ways so that I get over this problems.
Thanks.
LTBinh from Vietnam
nahp
Forum Newbie
Posts: 7
Joined: Mon Apr 22, 2002 3:24 am

Post by nahp »

the directive name is include_path, this is a list of directories not of files
try this:
include="C:PHP"
User avatar
pHaZed
Forum Commoner
Posts: 28
Joined: Wed May 01, 2002 2:44 am
Location: Sydney -AU

Solution..?

Post by pHaZed »

I had the same problem on my server,
My problem was resolved simply by commenting out / or deleting the include_path=
setting in php.ini
Also,
Say the file you wanted to include is located in C:ApachePHP
And your wwwroot (or wherever your executing the script from) is located at C:Apachewww
You would include the file like so

Code: Select all

include("../PHP/class.html.mime.mail.inc");
../ = up a dir, use as many of these as needed
hitek
Forum Newbie
Posts: 1
Joined: Wed May 08, 2002 3:43 pm
Contact:

Another thing to remember...

Post by hitek »

with included files, make sure they are either outside the webroot or are using a parsed extension, otherwise it's possible for someone to look at the code inside your include files.
For instance, if index.php includes header.inc, and header.inc is in the webroot, and *.inc files aren't parsed by php.exe, someone could type in
http://www.yoursite.com/header.inc and actually see the code.
Post Reply