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 have a script that accesses a page on a remote server using an include(); This remote page returns a value that I want the script to obtain. Is possible to get hold of the value without the remote page having to post it back to the site, ie. so that the value can be used with the same script.
If you are including a page, then any values in that page will be available to the page to which it is included. You would need to know the name of the variable storing the value and then you could use it.
This is true on a local include ie. include("file.php"); but doesn't work if the file is on a remote server, ie. include("http://www.mysite.com/file.php");
The script that called it doesn't seem to be able to get the value
Sorry, if 'echo $var' was included in the remote script it WOULD display it but where it is it won't as it can't detect the variable in the remote script.
Maybe something like [php_man]CURL[/php_man] would be more appropriate as you can then work with a returned value. include() doesn't seem to offer that functionality with remote files.
curl could work with the output better than include though - I think that's what I were thinking at the time - also assumes that you have access to modify the output of the external file so that you can get the data you need outputted to be parsed .