Jump to content


Popular Content

Showing content with the highest reputation on 02/04/2019 in all areas

  1. 1 point
    First! Always check your inputs server-side! Clients can send you whatever the heck they want! The required attributes are good enough for people who wish to use your website legitimately, but you have to be careful of those who don't. To get what you desire, you'll want to create an AJAX request. Its not my usual tactic to hand out code, but if you want it HTML: <FORM NAME="Betrugseingabe"> <INPUT TYPE="submit" NAME="Absenden" VALUE="Absenden" ID="Schaltflaeche1" ONCLICK="send_form();return false;"> JavaScript: function handle_response() { if(this.status == 200){ //Output Success or something? //Redirect? //Something happens if you don't error out } } function send_form() { var the_form = document.querySelector("form"); var formData = new FormData(the_form); var request = new XMLHttpRequest(); request.addEventListener("load", handle_response) request.open("POST", "../cgi-bin/DBinsert.php"); request.send(formData); } Disclaimer: Untested
  • Create New...