
-----------------------------------
Amailer
Thu Jul 03, 2003 8:55 pm

Including!
-----------------------------------
HELP!!


$include = array('function, 'mysql');


for($j=0; $j < count($include); $j++)

include $include[$j].".php, ";


THAT DOES NOT WORK!,
ITS SUPPOSE TO INCLUDE THE FILES "function" AND "mysql", but i guess i could not do it that way.

CAN ANYONE TELL ME A WAY TO INCLUDE MORE THEN 1 FILE USING 1 INCLUDE LINE? (THATS :  INCLUDE "WHATEVER";  )

THANK YOU!

-----------------------------------
PaddyLong
Thu Jul 03, 2003 10:36 pm


-----------------------------------
umm, it looks like you have typos in your code is all because I have done plenty of stuff like that before...  you seem to be missing a ' after function in your array declaration and also I am unsure why you have a , and space after .php in your include statment

also are you sure that your directories are correct (like that there shouldn't be some directory on function.php and mysql.php)?

-----------------------------------
Amailer
Thu Jul 03, 2003 10:46 pm


-----------------------------------
ok ok ok the code works and 


$include = array('function', 'mysql');


for($j=0; $j < count($include); $j++)

include $include[$j].".php"; 


Ok thats how it is..its correct, the thing is  that hte include ""; does not allow more then 1 file WHAT I MEAN IS i.e. include "file.php, file2.php...it goes on";

So is there a way that i can make it include more then one file, rather then doign.


include "file1.php";
include "file2.php";
include "file3.php";
...


Anyone would like to help?

-----------------------------------
PaddyLong
Fri Jul 04, 2003 12:14 am


-----------------------------------
shouldn't it be

$include = array('function', 'mysql'); 


for($j=0; $j < count($include); $j++) 

include $include[$j].".php"; 


you were still forgetting the ' after function in your array declaration

-----------------------------------
Amailer
Fri Jul 04, 2003 2:39 pm


-----------------------------------
Ah yes, ok ok i know, but the include does not allow:




which is what the script above ( on the above post you posted/edited )
does....Is there another way?

-----------------------------------
octopi
Fri Jul 04, 2003 9:23 pm


-----------------------------------
I don't see the point of what you are trying to do, but this works:




-----------------------------------
Amailer
Fri Jul 04, 2003 9:54 pm


-----------------------------------
thx, point is that im includign more then 20 files from diffrent places :) (( not ont he sameserver))
its kidna stupid...but yes

-----------------------------------
PaddyLong
Fri Jul 04, 2003 10:11 pm


-----------------------------------
what's wrong with the for loop and array?
