Submit form without having loaded corresponding page?

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

  1. jetmarc

    jetmarc Guest

    Hi.

    I hope that .javascript is the correct group for this question. I
    have
    a device with embedded webserver. Its page offers to reset the
    device,
    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"
    form.submit()
    }
    }

    Now I want to execute the reset function automatically on a
    timeschedule
    (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
    browsing
    the page and clicking the button manually?

    Marc
     
    jetmarc, Jul 25, 2003
    #1
    1. Advertising

  2. jetmarc

    Zac Hester Guest

    "jetmarc" <> wrote in message
    news:...
    > Hi.
    >
    > I hope that .javascript is the correct group for this question. I
    > have
    > a device with embedded webserver. Its page offers to reset the
    > device,
    > 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"
    > form.submit()
    > }
    > }
    >
    > Now I want to execute the reset function automatically on a
    > timeschedule
    > (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
    > browsing
    > the page and clicking the button manually?
    >
    > Marc



    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/somedaemon.sh 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).

    HTH,
    Zac
     
    Zac Hester, Jul 31, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TJS
    Replies:
    1
    Views:
    1,742
    Kevin Spencer
    Mar 2, 2005
  2. Replies:
    2
    Views:
    6,371
  3. jetmarc
    Replies:
    0
    Views:
    90
    jetmarc
    Jul 25, 2003
  4. Replies:
    2
    Views:
    400
  5. Replies:
    3
    Views:
    790
Loading...

Share This Page