> -----Original Message-----
> From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 3:51 PM
> To: Boyd, Todd M.; php-general@lists.php.net
> Subject: RE: [PHP] Include Problem
> 
> 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?

Alice,

exec() will execute Windows commands, as well. However, I'm not sure I
understand the reason for separating your script into two files--the
remote and the local scripts.

I will assume you are gathering data in your script (local), shipping
this off to a script on the client's machine (remote), and passing a
program (C/Python/Whatever) values you gathered using your script
(local).

Under this assumption, I would gather the data via
form/extraction/upload/whatever, and use cURL (a PHP library) to "visit"
the remote script, passing values either via GET or POST. The remote
script would then parse these values and send them to the appropriate
exec() command.

Am I off base?


Todd Boyd
Web Programmer




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to