Execute another PHP script -
i have cron job calculates disk space on servera
i have mysql database on serverb stores disk space values
servera in not allowed access mysql database on serverb (rules out direct mysql connect)
servera cannot open files on serverb (rules out include();
)
servera , serverb have no shell_exec()
abilities
i've tried header("location: http://serverb.com/record.php?disk_space=$disk_space");
using method receiving file $_request
values works when run through browser , not when run cron job.
i think there no proper alternatives. i'm happy peculiar or scruffy solution. please put forward ideas. tia
you can hit external scripts directly through number of http libraries -- file_get_contents()
.
see:
- file_get_contents - accepts url filename
- curl - http library
- http - http library
you use sockets make request:
lots of options (more included here). easiest, if needs simple, file_get_contents
.
Comments
Post a Comment