SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: mail() in PHP

Hybrid View

  1. #1
    SitePoint Enthusiast raynebair's Avatar
    Join Date
    Dec 2000
    Location
    Alabama
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a special library I need to include to use the send mail function. I want users to be able to type their email address in a form, choose subscribe or unsubscribe then click submit and have it send mail doing the appropriate action.

    I keep getting the following error: Fatal error: Failed opening required 'mailinglist.php' (include_path='./:/usr/local/lib/php')

    mailinglist.php is a file that has the code that I am inserting into my rightcell content in my page.


  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, are you administering your on server, it seems someone has screwed with the include path directive and set it to /usr/local/lib/php So any file that you include in your page using include() would have to live in that directory, you need to either set that directive in your php.ini file to equal "" or you need to do it in an .htaccess file in your web root like

    a .htaccess file with the following line it

    php_value include_path ""
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if it is not in the same directory as your php script it cannot find that mailinglist.php.
    you should give full path like
    include("/home/youraccount/includes/mail/mailinglist.php");
    hope this helps
    Great Dane
    Gokhan ARLI

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    gokhana it doesn't matter if you inlcude a full path to the file; if the include_path directive is set to something then your path would either need to be relative to that location or your file would need to be in the dir specified in the directive.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you give include a full system path and the include directive is set to something odd then the include will find the file as long as you give it the correct path.

    Also the include path above included the current directory the . in the include path.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  6. #6
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes the correct path - relative to the odd setting in the include_path directive. If your include_path directive is set to /usr/local/lib/php

    Say you have include("/usr/home/www/somefile.inc");

    Unless your file is located at /usr/local/lib/php/usr/home/www/somefile.inc

    Your system ain't gonna find it.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  7. #7
    SitePoint Enthusiast raynebair's Avatar
    Join Date
    Dec 2000
    Location
    Alabama
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all. I'm new at this php stuff. apparently I was using a require instead of an include. I also changed it so that it is using the complete path from the localhost. Seems to be working. Now let's see if my actual code works the way I want it to!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •