hi
i have a php page and i want to run it after every 10 hours automatically. How this can be achieved pls help :mad:
Printable View
hi
i have a php page and i want to run it after every 10 hours automatically. How this can be achieved pls help :mad:
if you're using a unix based server, look up how cron jobs work, or ask your host. if you're doing it locally or just on a windows server, look up how scheduled tasks work.
hi i have set up this cron job and also but i have not yet received any email from my e_mail.php
also i add this cronCode:* * * * * /usr/bin/php -q /home/user/public_html/e_mail.php
and i received emails from my second cron. why first cron is not working?Code:ls -a
hi
i can run my second page now with the cron job, with this command
but i want to use header() function in in my php page which is added to cron job but i dont get it workingCode:* * * * * /usr/bin/php -q /home/user/public_html/e_mail.php
Code:<?
header("location : http://remote.com/page.asp");
?>
you can't use a header like that because the PHP binary is running the script, not a browser.
So please suggest me any other option
i have tried
the code is in my php page which is added in cron job isCode:file_get_contents
and the page on the remote site contain this codeCode:<?php
$contents = file_get_contents("http://remotesite.com/remotepage.php");
?>
it works fine and when i see this pageCode:<?php
$f=fopen("remotepage.php","a")
fwrite($f,"text added<br>");
fclose($f);
mail("[email protected]","Subject here","the body");
?>
on my browser i see that new text is added into this page. But i do not get the email.Code:http://remotesite.com/remotepage.php
but when i use this code in remotepage.php i get the email from the server where the original cron job page is uploaded.
and emailpage.php contain this codeCode:<?php
$f=fopen("remotepage.php","a")
fwrite($f,"text added<br>");
fclose($f);
$c = file_get_contents("http://originalsite.com/emailpage.php")
?>
and i get the email this way.
do you think that this will solve the issue?
@ Chunk,
Is there any reason why you are using two php files? Why not combine the two?