Jump to content

how to include the results of another php file


Recommended Posts



To start I am quite new to PHP, so this will probably be a question from the 'noob' level.


I would like to combine two php files. The first php file post a certain message. The second file retrieves something from a database what I want to include in the message. I found a suggestion somewhere to use ob_start().


$post_message = 'message';

I put the standardized text between the quotes. Obiviously the code below doesn't work, but I don't know how to fix this.


include 'otherfile.php';
$result = ob_get_clean();

$post_message = 'message + $result';

Does someone know how I can include the result from the second php file into the message?


Thanks in advance!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.