Prevent page from submit on Refresh in PHP

If the form is already submitted and the user tries to refresh the webpage then the browser will attempt to resubmit the form.

If you are allowing the user to fill and submit the form for insert data. In this case, if the user refreshes the page then the data is reinserted into the MySQL database table if some action does not perform for preventing it.

In this tutorial, I show you some ways by using which you can avoid the page resubmit.

Prevent page from submit on Refresh in PHP

Read more

.addClass() and .removeClass() methods in jQuery

In jQuery, there are various methods like – switchClass(), toggleClass(), addClass() and removeClass() by using them you can easily add or removes classes in the elements.

For using switchClass() method you need to include jQuery UI library within your page but you can simply use toggleClass(), addClass() and removeClass() without any dependency other than jQuery.

In this tutorial, I discuss about addClass() and removeClass() method.

.addClass() and .removeClass() methods in jQuery

Read more

How to use Order by with Multiple columns in MySQL

The data is not displayed in any particular order when you simply fetch it from the MySQL table. For displaying data in some meaningful way ORDER BY clause is used.

This sorts your result on the basis of the column name specified in the clause within the SELECT query.

It allows us to –

  • Specify ordering in single or multiple columns
  • Define sort results in ASC or DESC format.

How to use Order by with Multiple columns in MySQL

Read more