SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Hybrid View

  1. #1
    SitePoint Evangelist ikeo's Avatar
    Join Date
    Oct 2004
    Location
    Austin Texas
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I automatically submit a form each day

    The form in question is a contact form of one of my new clients.
    It brings in a lot of leads for them and they are paranoid about it breaking and them losing leads for an indeterminate amount of time.

    They want me to write something that fills out the form and submits it automatically everyday ... any ideas?

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Use Snoopy (or your own code if you so choose) to submit the form.

    Make a cronjob to run the script once a day.

  3. #3
    SitePoint Evangelist ikeo's Avatar
    Join Date
    Oct 2004
    Location
    Austin Texas
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much for the help ... I looked at it and then used some code featured on the PHP fsockopen() page. Works like a charm, I just need to set the cronjob.
    Thanks again.

  4. #4
    SitePoint Member mjlogan's Avatar
    Join Date
    Apr 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GET http://www.yourdomain.com/script_name.php > /dev/null

    and just set the time for whenever you want the script to run.

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What's that supposed to be? It's not PHP code, and GET is not a Linux command. Nor does it look like it posts data to a form.

  6. #6
    SitePoint Member mjlogan's Avatar
    Join Date
    Apr 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a cron job from cPanel to execute script in a PHP file.

  7. #7
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    He didn't say he has cPanel, GET is not a linux command, and accessing a URL when the file is local is just odd.

    Cron syntax to run a PHP script every day at midnight:
    0 0 * * * /usr/local/bin/php /home/user/public_html/example.php

  8. #8
    SitePoint Member mjlogan's Avatar
    Join Date
    Apr 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wouldn't

    0 0 * * * GET http://www.yourdomain.com/script_name.php > /dev/null

    that work as well though?

  9. #9
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    [root@gold v3]# GET
    bash: GET: command not found
    "GET" is not packaged with Red Hat Enterprise Linux.

  10. #10
    SitePoint Member mjlogan's Avatar
    Join Date
    Apr 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It must be part of Cpanel then.


Bookmarks

Posting Permissions

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