bdmovies Posted January 10, 2009 Share Posted January 10, 2009 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 More sharing options...
ratcateme Posted January 10, 2009 Share Posted January 10, 2009 if you got rid of all the output on the remote file and then went $numberofrows = file_get_contents("http://remote/file/php"); Scott. Link to comment https://forums.phpfreaks.com/topic/140239-solved-remote-includes/#findComment-733809 Share on other sites More sharing options...
bdmovies Posted January 10, 2009 Author Share Posted January 10, 2009 Beautiful! On a more technical note - what exactly defines "output"? I'm echoing a statement, but is that output? Apparently not, seeing as how this worked - just wondering. Link to comment https://forums.phpfreaks.com/topic/140239-solved-remote-includes/#findComment-733810 Share on other sites More sharing options...
DarkWater Posted January 10, 2009 Share Posted January 10, 2009 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? Link to comment https://forums.phpfreaks.com/topic/140239-solved-remote-includes/#findComment-733812 Share on other sites More sharing options...
bdmovies Posted January 10, 2009 Author Share Posted January 10, 2009 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. Link to comment https://forums.phpfreaks.com/topic/140239-solved-remote-includes/#findComment-733815 Share on other sites More sharing options...
DarkWater Posted January 10, 2009 Share Posted January 10, 2009 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. Link to comment https://forums.phpfreaks.com/topic/140239-solved-remote-includes/#findComment-733817 Share on other sites More sharing options...
ratcateme Posted January 10, 2009 Share Posted January 10, 2009 sorry what i meant was i didn't know if the page just outputted the number of rows or it might have also had some other debug output or something Scott. Link to comment https://forums.phpfreaks.com/topic/140239-solved-remote-includes/#findComment-733829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.