php daemon vs passing data to website

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
10lojzo
Forum Newbie
Posts: 4
Joined: Mon Nov 02, 2009 10:42 am

php daemon vs passing data to website

Post 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!
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Re: php daemon vs passing data to website

Post 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.
10lojzo
Forum Newbie
Posts: 4
Joined: Mon Nov 02, 2009 10:42 am

Re: php daemon vs passing data to website

Post 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
Post Reply