Submit form without having loaded corresponding page?

Discussion in 'Javascript' started by jetmarc, Jul 25, 2003.

  1. jetmarc

    jetmarc Guest


    I hope that .javascript is the correct group for this question. I
    a device with embedded webserver. Its page offers to reset the
    with the following javascript function:

    function Restart()
    if (confirm("Your Web browser will lose contact with the
    camera.\nAre you sure you want to restart the camera?"))
    var form = document.WizardForm
    form.do_reboot.value = "yes"

    Now I want to execute the reset function automatically on a
    (every 24 hours, from crontab). How do I accomplish this? I guess I
    need something like the reverse of WGET - something like a WPUT or
    WSUBMIT, that talks to the embedded web server and submits a form with
    do_reboot = "yes". However, I have never heard of any such tool.

    How can I trigger the functionality in an automated way, without
    the page and clicking the button manually?

    jetmarc, Jul 25, 2003
    1. Advertisements

  2. jetmarc

    Zac Hester Guest

    IMO, you're making things too complicated. If you have access to set cron
    jobs, you don't need to go through your HTTP server to accomplish something.
    If it were me, I would look at the Perl script or PHP or whatever your form
    is being submitted to (with the action="" attribute), find the line that
    makes the call to reset the camera (it's probably a shell command anyway)
    and put it in a shell script that can be called from cron. If you really
    want to have control over this, look up any man pages about the drivers or
    control programs that allow you access to the device. A lot of things are
    restarted via a shell script anyway:

    /usr/local/etc/rc.d/ restart

    (Your mileage may vary.)

    Let me know if you need help finding out what the server-side script is
    doing (you can email me the code from the server-side script).

    Zac Hester, Jul 31, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.