Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refresh page after form submitting

Tags:

I have a little problem. I want to reload my page after submitting a form.

<form method="post" action="">    <textarea cols="30" rows="4" name="update" id="update" maxlength="200" ></textarea>    <br />    <input type="submit"  value=" Update "  id="update_button"  class="update_button"/> </form> 
like image 925
Dário Viegas Avatar asked May 17 '12 21:05

Dário Viegas


People also ask

Do not refresh page after form submit?

Use the preventDefault() method on the event object to prevent a page refresh on form submit in React, e.g. event. preventDefault() . The preventDefault method prevents the browser from issuing the default action which in the case of a form submission is to refresh the page.

How do you stay in the same page after submit a form in HTML?

How do you stay in the same page after submit a form in HTML? 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: “.

How do you refresh the page after submit in PHP?

Use header() function to refresh a web page in PHP. The HTTP functions are those functions which manipulate information sent to the client or browser by the Web server before any other output has been sent. The PHP header() function sends an HTTP header to a client or browser in raw form.


1 Answers

only use

 echo "<meta http-equiv='refresh' content='0'>"; 

right after insert query before } example

if(isset($_POST['submit']))         { SQL QUERY---- echo "<meta http-equiv='refresh' content='0'>"; } 
like image 118
Gul Nawaz Avatar answered Oct 02 '22 01:10

Gul Nawaz