My problem is the following, I have an EmailReports.php on my server which I use to send mails like EmailReports.php?who=some@gmail.com&what=123456.pdf
I can NOT modify EmailReports.php since that belongs to a diferent project and it instantly sends an email and has been aproved by QA team and all that stuff.
Now, on a diferent LookReports.php I need to offer a service like “Send me the reports I reviewed” which manually can be easily executed as just calling EmailReports.php, the question is, how can I do it by PHP code? so it calls the other PHP automatically.
I have tried without success:
$stuff = http_get("http://...<the url here>");
and
$stuff = file_get_contents("http://...<the url here>");
I was thinking on import the EmailReports.php but does not seem right since there is no functions, it automatically sends an email.
Or I could replicate EmailReports.php code but that is against the QA policy since extra tests would be needed.
Could you guide me a bit?
Thanks in advance.
You could use a Curl request to retrieve information (xml/html/json/etc) from any website.
What is CURL? (short answer)
Source : PHP, CURL, and YOU!
Example of Curl function in PHP
Source : Download a URL’s Content Using PHP cURL
Usage
Try to test it, with other websites because more often than not
googlewill return a404 request(this is to be expected), after a curl has been executed.