Hi. I m a new player in PHP and MySQL programming. I m trying to trigger a remote PHP script from a local PHP script. I would appreciate if anyone can help me.
remote script:
http://remotedomain/updateremotedata.php?v1=x&v2=y
local script:
if($GO) { how to call the remote script above }
else { echo "remote is not called"; }
should i use exec(), system() or something else?
Hpow to call a remote script without a click
Moderator: General Moderators
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
unfortunately, that won't work the way you think. what will end up happening is that the remote script will be executed on the remote server and then the output will be sent to your script. if all you want is the output of that script then this is fine. however if you want to access the variables, functions and other code within that script then that is not possible (at least not that ive seen). take a look at example 12-5 on this page: http://www.php.net/manual/en/function.include.php
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
Thanks a lot for the responce,
assuming i have the permission to access the remote script, will i be able to trigger the remote script with the specify variables?
I do not need the output of the remote to be passed back to the local script. But, i need to update the remote server by running the remote script with these variables.
Is this possible??
assuming i have the permission to access the remote script, will i be able to trigger the remote script with the specify variables?
I do not need the output of the remote to be passed back to the local script. But, i need to update the remote server by running the remote script with these variables.
Is this possible??
Yeah do something like
Code: Select all
<?php
$x = "blah blah";
$y = "blah";
include("http://remotedomain/updateremotedata.php?v1=$x&v2=$y")
?>