Page 1 of 1

php daemon vs passing data to website

Posted: Tue Jan 12, 2010 12:01 pm
by 10lojzo
Hi people. Id like to create some service, which would download emails from my account once a day, process data and store it to database. I googled and found out something about daemons but my problem is i dont have access to server. Im programming also in C# and i thought about creating windows service which would download my emails and then send it to my website(addressing some php script) What approach would you suggest? If the latter is the option, how can I pass data to my php script? Thanks!

Re: php daemon vs passing data to website

Posted: Tue Jan 12, 2010 12:16 pm
by SidewinderX
Generally if you request it, most hosts will give you jailed shell access to the server. You could then just run a php script using a cron job.

Re: php daemon vs passing data to website

Posted: Mon Jan 25, 2010 4:04 am
by 10lojzo
I focused on creating windows service and passing data to my webservice in querystring as long as the data need not to be secured. My php script for looks like this:

<?php

Code: Select all

echo '<?xml version="1.0" /?>';
echo '<root>';        
     /*getting all variables from query string with $_GET['myvariable']*/
     /*processing data and storing them to database*/
     
     echo '<response>Ok</response>';
echo '</root>';
?>
/*If you want to get the response from your script, you need to use xml.*/
/*echo '<?xml version="1.0" /?>' - use echo because hosting server is sometimes configured with short_open_tag=OFF and if so, this line could generate error, if used without echo