Home / Internet & Networking / Web design / Why is this PHP code STILL erroring me?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Why is this PHP code STILL erroring me?  (Read 604 times)
Bannana97
Topic Starter
Intermediate



Posts: 145



Owner of HerbertsWorld Corporation

HerbertsWorld - Free Websites
« 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");
}
IP logged

Thanks
Bannana97
Google
Adviser



Thanked: 2
Posts: 997

AC Milan #80

« 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.
IP logged

BC_Programmer
Mastermind


Thanked: 682
Posts: 15,624

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« 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");

}

IP logged

Bannana97
Topic Starter
Intermediate



Posts: 145



Owner of HerbertsWorld Corporation

HerbertsWorld - Free Websites
« Reply #3 on: November 18, 2009, 07:01:56 AM »

Yeah I found that out 5 minutes after this thread. . . .
IP logged

Thanks
Bannana97
Pages: [1] - (Top) Print 
Home / Internet & Networking / Web design / Why is this PHP code STILL erroring me? « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.083 seconds with 20 queries.