Skip to main content

Links

Comments

Popular posts from this blog

.htaccess file

What is .htaccess file? A .htaccess file is an ASCII file. It is a short form of  Hypertext Access. It is a configuration file used by Apache-based web servers . The  .htaccess is the file’s extension. It is not a file  name.  It will affect on the folder  in which it is located and also on subfolders. we can use .htaccess for following Remove file extension Redirect to custom error pages Block or allow IP addresses Prevent directory listings How to remove .php extension from URL? Create .htaccess file in root of your project and add following code in it RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php Before  URL is like www.example.com/home.php After adding .htaccess it will be like www.example.com/home Redirect to custom error pages It is used to redirect the user to a custom error page by using the error code. Following are error codes 400 – Bad reque...

Form submit using AJAX

AJAX = Asynchronous JavaScript And XML     AJAX is a client-side script which is used to communicate to the server.  It is used to get or submit the data or update the part of the webpage without refresh the page.  When we want to submit a form, first we get the form data using serialize method following code:- var datastring = $("#create-from").serialize(); If want to send custom data then, var datastring = {name:"ABC",email:"abc@gmail.com"} Now we will submit the form data using ajax $.ajax({      type:'POST',      url:'asySubmit.php',      data:datastring,      beforeSend: function(){                         $('.loader').show();      },      success:function(response) {              console.log(response);      },     ...