PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
i dont know if this can be done....especially the way that I am handling my code...I have tried several methods of including....right now my page is all css ran with all divs..and im wanting to take and display a php page within the content div...here is what i got
You can include a file in the middle of a string. And you need to close your strings with an end quote (i.e., if you start with $display_block .=" you need to end with "; ).
If you want the include file to append to the string the put a $display_block .="..."; inside it, or use the output buffering methods to capture the output into a string.
thanks chris but i have tried this and have posted it back, is the $display_block .="..."; wrong
Christopher wrote:You can include a file in the middle of a string. And you need to close your strings with an end quote (i.e., if you start with $display_block .=" you need to end with "; ).
and are you sugessting that I use another method here...if so can you show me an example because when i use the include inside or outside the display block I get the parse error. if I paste the contents of the file outside of the file i want to inclue it gives me a parse error until i remove the begining and closing php tags...then it actually works...but the information is not inside of the <div> tag I placed it between and it begins to echo out code the code under it.
can you show me an example of what you mean here if what i have tried is not what you are mentioning here?
Christopher wrote:
If you want the include file to append to the string the put a $display_block .="..."; inside it, or use the output buffering methods to capture the output into a string.
i dont know if this matters or not but the file that i am trying to include is a excelreader file that is already working...now i got it to either say that it cant read the file when i get rid of the parse errors...so i did this
Obadiah wrote:If you want the include file to append to the string the put a $display_block .="..."; inside it, or use the output buffering methods to capture the output into a string.
[/quote]
Either do $display_block .=" inside "folder/example.php" or wrap the include in output buffering methods like this:
Obadiah wrote:If you want the include file to append to the string the put a $display_block .="..."; inside it, or use the output buffering methods to capture the output into a string.
Either do $display_block .=" inside "folder/example.php" or wrap the include in output buffering methods like this: