D
D
david25552018-04-16 18:18:22
PHP
david2555, 2018-04-16 18:18:22

How to auto submit form via php?

hello i have this form

<form action="" id="formid" name="formname">
   <input name="txt" type="text" />
   <input id="subm" name="subm_1" type="submit" />
</form>

Please tell me how can I do it through php so that when the page is opened, the form is sent automatically without clicking on submit, and if it’s not possible through php, tell me how to do it through javascript ... all thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Sklyarov, 2018-04-16
@david2555

Jquery:

$(document).ready(function(){
   $('#formid').submit();
}

V
Vitaly, 2018-04-16
@rim89

the user passes data through the form, which is passed to PHP in the form of $_POST or $_GET array elements,
there is no point in the form if nothing is entered into it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question