Search

Friday, October 29, 2010

simple login system using php

login system is very common in php. In this post you can get an idea to make a login system in php. Before the starting the coding for login system you have to check what you want to represent to the user on login panel. You have to use some CSS to give better look for login panel.

here is php code for login system :

// first we check the name of submit button is set or not
if(isset($_POST['submit']))
{
   $name = $_POST['username'];
   $pass = $_POST['password'];

// check the value of input box
   if($name == "")
       echo 'Name field is empty!';
   elseif($pass == "")
       echo 'Password filed is empty!';
   else
   {

      // temporary username and password
      $uname = 'user1';
      $upass = '12345';

      if($name == $uname && $pass == $upass)
         echo 'Welcome : ' . $uname;
      else
         echo 'Username or Password didn't match!';

   }
}

You can change username and password as you want. It just a idea for login system. Hope it will help you to develop a login system.

Friday, October 22, 2010

echo the php code with the help of jquery and css

hello friends,
it's so cool to having work experience with multiple things. In this example i want to share tell a simple way to add css, jquery with php.
here is my example.

$string = "Hello world!";

now we have to give some css in our example

.p_style{
 color:#ff6600;
 background:#ccc;
 padding:5px;
 }

now lets work

Related Posts Plugin for WordPress, Blogger...