Showing posts with label Mysql. Show all posts
Showing posts with label Mysql. Show all posts

Friday, July 20, 2012

PHP…MYSQL…JQUERY… Starting History at a glance

Nowadays one of most used open source web development script is PHP. Because PHP is easy to learn as well as easy develop website and web application easily with short period of time.

When we create PHP, No need to invest money to purchase all the supporting softwares are open source.

About PHP:

The great open source PHP creator is : “Rasmus Lerdorf”
Top know more about PHP language creator visit following,
  1. http://en.wikipedia.org/wiki/Rasmus_Lerdorf
  2. http://lerdorf.com/bio.php
  3. http://www.oracle.com/technology/pub/articles/php_experts/rasmus_php.html

About MYSQL:

PHP is frontend scripting language, When we need to store the data, we need backend database. MYSQL one of the powerful databases to store the data’s in the backend. Mysql is also an open source.
The creator of MYSQL is : “Michael Widenius”
  1. http://www.mysql.com/

About Jquery:

Process is done without page reloading... So we go for an jQuery. jQuery used to create fast web based application with any events, animations and also interact with ajax functionality. to know more about this,
  1. http://docs.jquery.com/Tutorials
Leader of jQuery :“John Resig”

By PHP with No comments

Wednesday, November 17, 2010

Login Page creation using PHP/MYSQL

When you are going to create login, you should follow the following steps

Technology : PHP
Database MYSQL
Server : WAMP

1. Create the user table
CREATE TABLE `Users` ( `user_id` int(4) NOT NULL auto_increment, `username` varchar(65) NOT NULL default '', `userpassword` varchar(65) NOT NULL default '', PRIMARY KEY (`user_id`) ) TYPE=MyISAM AUTO_INCREMENT=1 ;


   Insert user login information into table

INSERT INTO users VALUES (1, 'john', '1234');


2. Create the login page like mylogin.php
<form id="form1" name="form1" method="post" action="my_login_action.php">
  <table border="0"  width="95%" cellpadding="0" align="center" cellspacing="0" >
    <!--DWLayoutTable-->
    <tr>
      <td colspan="4" height="25" align="left">&nbsp;</td>
    </tr>
    <tr>
      <td  width="68"></td>
      <td height="35" width="173" align="right" valign="middle">My e-mail address is:</td>
      <td  width="7"></td>
      <td width="441" align="left" valign="middle"><input name="login_email" type="text" id="login_email" maxlength="50" />
      </td>
    </tr>
    <tr>
      <td  ></td>
      <td height="35"  align="right" valign="middle">My password is:</td>
      <td  ></td>
      <td align="left" ><input name="login_password" type="password" id="login_password" maxlength="50" />
        </span></span></td>
    </tr>
    <tr>
      <td height="45" colspan="4" align="right" valign="middle"><label>
        <input  name="Login" src="images/log-in-button.gif"  type="image" id="Login" value="Login" />
        </label>
      </td>
    </tr>
  </table>
</form> 

3. Create the login action file as my_login_action.php
 
if($_REQUEST['Login'])
{
    extract($_REQUEST);
    
    $_check_login = "Select * from  Users where username = '$login_email' && userpassword = '$login_password'";
    $_check_login_01 =     mysql_query($_check_login) or die(mysql_error());
    if(mysql_num_rows($_check_login_01) > 0)
    {
        
            header("Location: successlogin.php");
            exit();
        
    }
    else
    {
        header("Location: failurelogin.php");
        exit();
    }
    
} 
 
4. Create the login success page as successlogin.php
        <?php
        // Check if session is registred or not. If not redirected to main page of the php
        // paste this code on the first line in the page of php 
        
        session_start();
        if(!session_is_registered(successusername)){
        header("location:main_success_login.php");
        }
        ?>
        
        <html>
        <body>
        my php page  Successfully logged in
        </body>
        </html>
        </body>
        </html>

5. Create the login failure page page as failurelogin.php


        <?php
        // if login failed, page redirected to the main login page
        // paste this code on the first line in the login page of php 
        
        session_start();
        if(!session_is_registered(successusername)){
        header("location:main_login_page.php");
        }
        ?>
        
        <html>
        <body>
        you are mentioned user name or password is wrong
        </body>
        </html>
        </body>
        </html>

6. Create the Logout page page as logoff.php
     // Paste this code on the top off the logoff.php page.
        <?php
        session_start();
        session_destroy();  

Tags: php, Mysql, php login page, php mysql page, login page, email using php login, login using php, logout pge, logoff, create database, login success, login failure, login success php, login failure,php

By PHP with No comments

    • Popular
    • Categories
    • Archives