Hello,
I'm having a php issue that I imagine would be very easy to solve if I knew what to be searching for, and provided it's possible, which it really seems like it should be. I am writing a script, and I want to be able to run a remote php script and use the result of that in this script. For instance, the script at http://www.mydomain.com/script.php?variable=3 will, when run in a browser, write out a string. I want to write a php script on another domain that, when run, will call the first script, get the string it writes out, and use it to do something else.
Any help on how to do this, or a term to describe it that I could be searching for would be most appreciated,
Thanks,
Rob
Reading remote text?
Moderator: General Moderators
- akimm
- Forum Contributor
- Posts: 460
- Joined: Thu Apr 27, 2006 10:50 am
- Location: Ypsilanti Michigan, formally Clipsburgh
##EDIT I may have misread the question, if so as feyd said, file_get_contents will dump the contents of one page, I thought you wanted to implement the script into your site.
PHP.net or google would do this trick.
the function(s) you're searching for vary on the exact purpose,
They all serve the same basic purpose, but there are nuances in their usage.
PHP.net or google would do this trick.
the function(s) you're searching for vary on the exact purpose,
Code: Select all
<?php
include("http://www.phonybolognesite1.com/file.php");
require("http://www.phonybolognesite1.com/file.php");
include_once("http://www.phonybolognesite1.com/file.php");
require_once("http://www.phonybolognesite1.com/file.php");
?>
Last edited by akimm on Wed Oct 18, 2006 1:27 pm, edited 1 time in total.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
file_get_contents() if the allow_url_fopen directive is enabled. If not, cURL or some relative (Snoopy, perhaps.)