" to achieve no redirection after submitting the form. Just jump."/> " to achieve no redirection after submitting the form. Just jump.">
Home > Article > Backend Development > How to implement php form submission without jumping
How to implement php form submission without jumping: first create the front-end code; then pass "59ae91dd0b12a90aaa6afb027e13409f891af37500392f05ebb1c8a2a6aafd55" to avoid jumping after submitting the form.
Recommended: "PHP Video Tutorial"
html form does not refresh or jump after submission The implementation method
cleverly uses iframe
By default, after the form is submitted, it is refreshed. However, sometimes, you want to not refresh the form after submitting it, so as not to wipe away the content already on the page. So what should I do (I happened to encounter it recently)? The example code is as follows:
<html> <body> <form action="" method="post" target="nm_iframe"> <input type="text" id="id_input_text" name="nm_input_text" /> <input type="submit" id="id_submit" name="nm_submit" value="提交" /> </form> <iframe id="id_iframe" name="nm_iframe" style="display:none;"></iframe> </body> </html>
After testing, the function has been implemented. After clicking submit, it does not jump or refresh, which is reliable. Among them, action can be set to the action to be triggered. In this example, I wrote it as empty.
The above is the detailed content of How to implement php form submission without jumping. For more information, please follow other related articles on the PHP Chinese website!