Posts

Showing posts with the label AJAX

Login Form Using Ajax and jQuery

Image
Hi friends, In the last post labeled under ajax category you learnt how to make user poll script using ajax and php.In this post we'll be creating an ajax login form using jquery and php. This post contains five simple steps which are as below. First of all we are creating database that contains the data of the registered users.To create the database just copy and paste the code given below in the step:1 Step:1 Create table - registered_users CREATE TABLE IF NOT EXISTS `registered_users`( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(20) NOT NULL, `password` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) Download Source Now we have database of the users.Its time to create a login form through which user can login.Create file named index.php and copy paste the code of step:2. Step:2 Create file - index.php In index.php file we'll have the small login form through which user can enter Username and Password.Entered data will be checked against the correct credentials for the...

User Poll Script using Ajax and PHP

Image
In this tutorial, we'll be creating an Ajax Poll Script that displays the results with colored images using PHP and Ajax. This is a very simple Ajax poll script. Poll results will be displayed on the current page without moving to another page. The result of the poll is stored in a separate text file and results will be displayed based on the values stored in this file.As the data is saved in flat file it  does not require any database .  Download index.php <html> <head> <script> function Vote(int) { if (window.XMLHttpRequest)   {// code for IE7+, Firefox, Chrome, Opera, Safari   xmlhttp=new XMLHttpRequest();   } else   {// code for IE6 and IE5   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");   } xmlhttp.onreadystatechange=function()   {   if (xmlhttp.readyState==4 && xmlhttp.status==200)     {     document.getElementById("poll").innerHTML=xmlhttp.responseText;     }   } xml...