RE: [PHP] Include Problem
| From: | Wei, Alice J. | Date: | Tue, 24 Jun 2008 20:50:58 +0000 |
| Subject: | RE: [PHP] Include Problem | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275926@lists.php.net to get a copy of this message | ||
Alice,
If you simply need to execute a remote PHP script and pass variables,
you could do it behind-the-scenes with cURL or AJAX, and pass the
variables in the url (i.e.,
http://www.mysite.com/script.php?param=value).
cURL is capable of
retrieving the page (read: the results of the executed script), which
can then be parsed by your local script.
I actually did something like this where I scraped the World of Warcraft
Armory (ok, groan. No, seriously, let it out). I grabbed their XML
pages, parsed the info, and then pushed this info to a script on a
remote site of mine. I had to do this because the remote site I was
working with did not have cURL installed (nor could I install it myself
due to access restrictions). The remote script would return "OK" or
"FAIL", and my script would expect one of these values and react
accordingly.
Is this a little bit more on target? I can supply you with source code
if you would like.
You could also use AJAX to populate an IFRAME with the results of a
remote PHP script, and then parse those values using a hidden form
submission, perhaps. Just some ideas.
I think that the variables passed to will be used by that code to do perform some operations on
another remote machine, (according to what I got from my client, he calls this behind the scenes to
avoid users screw up the front end, and he is thinking of using C, Perl or Python), which is why I
am hoping that I can produce one single script, and have it execute some script without the user
pushing any button. I don't think I plan on "scraping" websites. However, if you are
suggesting that it is easier to do in Ajax to do what I am intending to do here, I would love to
check it out and forget about PHP (hopefully not).
Most of the documentation I have been seeing on exec() seems to be executing UNIX commands at
http://us2.php.net/manual/en/function.exec.php.
One main issue, which I am not sure if it is entirely relevant, is that I am using PHP on Windows
with my current script, (the one to execute things from), while the script that would be executed is
located on a Linux machine. Would this be an issue when I am doing this with what I am trying to do
here?
Thanks in advance.
Alice