Jump to content

how to include the results of another php file


Idefix99
Go to solution Solved by Ch0cu3r,

Recommended Posts

Hi,

 

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.

 



ob_start();
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 thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.