Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Why is this PHP code STILL erroring me?  (Read 3337 times)

0 Members and 1 Guest are viewing this topic.

Bannana97

    Topic Starter


    Intermediate
  • Owner of HerbertsWorld Corporation
    Why is this PHP code STILL erroring me?
    « on: November 15, 2009, 07:47:53 AM »
    I said IF it works, not try and make it work (lol), but it gives me Warnings anyways:


    if(!include("docs/function.list.php")) {
    include("../docs/function.list.php");
    }
    Thanks
    Bannana97

    Google



      Mentor

      Thanked: 2
      • Certifications: List
      • Experience: Experienced
      • OS: Windows 7
      Re: Why is this PHP code STILL erroring me?
      « Reply #1 on: November 17, 2009, 08:10:24 PM »
      Don't know too much about PHP, but looks to me as though you're just trying to loop docs/function.list.php until it works, and obviously, that's erroneous in PHP programming.

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: Why is this PHP code STILL erroring me?
      « Reply #2 on: November 18, 2009, 01:24:36 AM »
      use file_exists() rather then using include the first time:

      Code: [Select]

      if(file_exists("docs/function.list.php"))
      {

      include("docs/function.list.php");
      }
      else
      {
      include("../docs/function.list.php");

      }

      I was trying to dereference Null Pointers before it was cool.

      Bannana97

        Topic Starter


        Intermediate
      • Owner of HerbertsWorld Corporation
        Re: Why is this PHP code STILL erroring me?
        « Reply #3 on: November 18, 2009, 07:01:56 AM »
        Yeah I found that out 5 minutes after this thread. . . .
        Thanks
        Bannana97