i am trying to include two different files in a same dir consecutevly but somehow onyl one is being included. it includes the first one it encounters. that is include("./files/file1.php"); include("./files/file2.php"); ^^In this case File1 is included. include("./files/file2.php"); include("./files/file1.php"); ^^Here file2 is included. Any Guesses ???
Nope this dosent help. my code is something link this :: include("./template/header.php"); include("./includes/file1.php"); include("./includes/file2.php"); include("./template/footer.php"); PHP: In above file2 is not included and not even footer but if i comment the third line then footer is include. same thing happens if i change the order of file1 and file2.
Theres no exit or Die anywhere in file1 and file2 (The code in them is almost equal). this can also be proved from the fact that Footer is included once one of the include (file1 or file2 ) is commented. sorry i cannot post the code. really sorry for that. i can post more details abt them. Majourly Use cURL and explode functions.
sorry but i really cannot put the Code. i have tried all different things possible even used include_once and all that but things are the same.
When including the separate files they may not work together if they contain any of the same variable names. They would work alright separately but then would be messed up based on which variables are defined already. Since include pulls the files together as one, it executes as one and sometimes introduces new problems.