Jump to content

Submitting a form


NLCJ

Recommended Posts

Hello,

I'm trying to automatically submit a (hidden) form once 30 seconds have passed, I already got the countdown and I got it like this:

<form name="hiddenform" id="hiddenform">
<input type="hidden" name="ipaddress" value="<?php echo $_SERVER[REMOTE_ADDR]; ?>" />
<input type="hidden" name="time" value="<?php echo date("H:i:s"); ?>" />
</form>

That's the form, now I want JavaScript to post it to another page (without changing the page), I didn't come any further than defining some variables...

var ipaddress = document.getElementById('hiddenform').ipaddress.value;
var time = document.getElementById('hiddenform').time.value;

Link to comment
https://forums.phpfreaks.com/topic/210955-submitting-a-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.