BR
asked on
How can I run the php script or the page without visiting the page?
I have a report page which I can create a report by only visiting the PHP page. ( I have username and password protection for this page)
How can I run the php script or the page without visiting the page?
For example I want to recieve the report everyday, but I have to visit the page to run the php script every day.
what do you suggest I should do?
I use PHP and mysql.
How can I run the php script or the page without visiting the page?
For example I want to recieve the report everyday, but I have to visit the page to run the php script every day.
what do you suggest I should do?
I use PHP and mysql.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome, glad to help.
Depending on the authentication type, cURL may be able to pass the credentials. See options for CURLOPT_HTTPAUTH, CURLOPT_USERPWD.
The cron job can do many things that a regular web script can do, however its environment will not be the same. Your first cron job should be something like this. The output will be hard to read, but worth working through to understand its environment.
The cron job can do many things that a regular web script can do, however its environment will not be the same. Your first cron job should be something like this. The output will be hard to read, but worth working through to understand its environment.
<?php
ob_start();
phpinfo();
$buf = ob_get_clean();
mail('you@your.org', 'cron phpinfo()', $buf);
Many servers will assume that cron failed if the cron script produces browser output. This makes sense because cron jobs are not intended to be run from the browser.
ASKER
Thank you Ray Paseur
ASKER
I realized that, I have Cron on my Cpanel. Cron solved my problem for good. Thank you all
ASKER