Jump to content

[SOLVED] Remote Includes


bdmovies

Recommended Posts

I need to include a remote file and need to put the results (the result of the mysql_num_rows()) into a variable. using include() isn't working, so I went to readfile() which is working, except it is outputting to the output buffer. Is there anything I can do that WON'T output to the buffer? I just need the value in a variable.

 

Ideas?

Link to comment
https://forums.phpfreaks.com/topic/140239-solved-remote-includes/
Share on other sites

if you got rid of all the output on the remote file and then went

$numberofrows = file_get_contents("http://remote/file/php");

 

Scott.

 

What does output have to do with anything?  All that file_get_contents() grabs IS output, so what do you mean?

Well, digging around php.net I THINK that file_get_contents puts its contents into a string where as readfile sends it to the buffer.

 

Not entirely sure though.

 

That's exactly what it does.  But I don't quite understand why he would say to make sure there was no output, as that would completely defeat the purpose of grabbing the file at all.

Archived

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.