PHP form - on submit stay on same page

后端 未结 9 911
醉梦人生
醉梦人生 2020-11-29 01:49

I have a PHP form that is located on file contact.html.

The form is processed from file processForm.php.

When a user fills out the

9条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 02:04

    In order to stay on the same page on submit you can leave action empty (action="") into the form tag, or leave it out altogether.

    For the message, create a variable ($message = "Success! You entered: ".$input;") and then echo the variable at the place in the page where you want the message to appear with .

    Like this:

    
    
    
        
    

提交回复
热议问题