php daemon vs passing data to website
Moderator: General Moderators
php daemon vs passing data to website
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!
-
SidewinderX
- Forum Contributor
- Posts: 407
- Joined: Fri Jul 16, 2004 9:04 pm
- Location: NY
Re: php daemon vs passing data to website
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
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
?>
/*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
<?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