Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    automation to run reports

    I have a fleet allocation report on my website, and what i'm wanting to do is this:

    users can register to have a weekly report sent to them on the fleet allocation, by registering to a mailing list
    once a week (possibly like midnight Sundays), the report will automatically generate, make it into a pdf form or something like that, then send to everybody on the mailing list.

    So firstly, is this possible?
    secondly, how could such be implemented into an existing script or would one have to be duplicated to do such functions?

    thanks in advance!

  • #2
    New Coder
    Join Date
    Jul 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is a nice report from zend on how to make pdf's

    http://www.zend.com/zend/spotlight/creatingpdfmay1.php
    PHP and MYSQL
    $string = "3Ip*hKEpanKI#8dmUys&*KqlIJ*P8D";
    $new_string = ereg_replace("[^a-z]", "", $string);
    echo "<a href=http://www.$new_string.org>$new_string</a>";

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    If you're on a Linux box, you're going to need a cron job to run a PHP script that makes the PDF file and then emails it out for you. A cron job is like a batch job and you can set it to run (execute) anytime you want so Sunday at 11:00pm is fine.

    If you're on a Windows server you'll have to check and see what they use that is like a cron job on Linux. I only host my sites on Linux boxes so I don't know what they use on Window servers.

    Next problem is, regardless of what kind of server you're on, is batch job permissions. On shared servers (you probably are on a shared server) some hosting providers do not allow cron (batch) jobs to run because they are difficult to debug and determine that they are running correctly since there is no GUI or other way to easily debug. There is a risk the script could run badly and in the worst case, tie up all or most of the CPU resources, etc.

    Hint: I run my cron PHP scripts in a browser so I can spit debug info onto the screen and check it that way. Anyway, check with your hosting provider and see if you can run a cron job. If you cannot then you can still do this but you'll have to manually run the PHP script yourself once a week.
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #4
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the replies. I noticed in my C-Panel last night a 'Cron Job' section and then once in it, had a choice between 'Standard' & 'Advanced (unix style)'

    I tried looking up different things about it, but have absolutely no idea as to do it.

    So it appears I probably can run 'Cron Jobs', but don't know what the syntax would be.

    I'm presumming what ever the wording in Cron Job would be, would be to run this page at this time and send to mailing list?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •