Bulletin.Com.Ng - Online Bulletin For Periodicals (newspapers magazines and journals)
  • Home
  • About Us
  • Our Services
    • Web Services
    • Music Promotion
  • Contact Us
  • Disclaimer
  • Privacy Policy
» php Tutorial » Php tutorial, Login script with Jquery

Php tutorial, Login script with Jquery

Kedeayei
Add Comment
php Tutorial
Monday, 28 August 2017
View Demo Download
On today's tutorial were gonna build an Php and Jquery login script.
To make it more easy i separated the article in 4 parts:
  1. Html Form
  2. Adding Php
  3. Jquery checks
  4. Final code
First of all we are goind to make the html form which it is well designed in css3


Php And Jquery Login tutorial




Please type something.












The php backend, just a simple login script for demonstration

if(isset($_POST['user']) && !empty($_POST['pass'])){
$uid = "mikel";
$pid = "thecodertips";
if($_POST['user'] != $uid){
die("Wrong username..");
}
if($_POST['pass'] != $pid){
die("Wrong password..");
}
echo 'Welcome.';
}
?>


Then the css part
input{
outline: none; /* removes google chrome outline */
}

#box{ /* the login box design */
width: 190px;
background-image: -webkit-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
background-image:    -moz-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
background-image:     -ms-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
background-image:      -o-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
background-image:         linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
-webkit-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(255,255,255,1)inset, 0px -16px 0px 0px rgba(237,237,237,1)inset;
-moz-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(255,255,255,1)inset, 0px -16px 0px 0px rgba(237,237,237,1)inset;
box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(255,255,255,1)inset, 0px -16px 0px 0px rgba(237,237,237,1)inset;
border: solid 1px #5E5E5E;
border-color: #5E5E5E #888888 #696969 #888888;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
border-radius: 16px;
padding: 0px 20px 0px 20px;
display: inline-block;
font-size: 15px;
line-height: 32px;
color: rgba(51,51,51,1);
}

#user, #pass{
padding: 8px;
color:gray;
margin: 10px;
-webkit-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(255,255,255,1)inset, 0px -16px 0px 0px rgba(237,237,237,1)inset;
-moz-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(255,255,255,1)inset, 0px -16px 0px 0px rgba(237,237,237,1)inset;
box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(255,255,255,1)inset, 0px -16px 0px 0px rgba(237,237,237,1)inset;
border: solid 1px #5E5E5E;
border-color: #5E5E5E #888888 #696969 #888888;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
border-radius: 16px;
}

#user:hover, #pass:hover{
border:1px solid #00BFFF;
color: black;
}

.button {
background-image:-webkit-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
background-image:-moz-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
background-image:-ms-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
background-image:-o-linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
background-image:linear-gradient(top, rgba(252,252,252,1) 0%,rgba(243,243,243,1) 100%);
-webkit-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(255,255,255,1)inset, 0px -16px 0px 0px rgba(237,237,237,1)inset;
-moz-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(255,255,255,1)inset, 0px -16px 0px 0px rgba(237,237,237,1)inset;
box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(255,255,255,1)inset, 0px -16px 0px 0px rgba(237,237,237,1)inset;
border: solid 1px #5E5E5E;
border-color: #5E5E5E #888888 #696969 #888888;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
border-radius: 16px;
padding: 0px 20px 0px 20px;
display: inline-block;
font-size: 15px;
line-height: 32px;
color: rgba(51,51,51,1);
margin-left: 25%;
}
.button:active {
background-image: -webkit-linear-gradient(top, rgba(167,199,225,1) 0%,rgba(124,176,222,1) 100%);
background-image:    -moz-linear-gradient(top, rgba(167,199,225,1) 0%,rgba(124,176,222,1) 100%);
background-image:     -ms-linear-gradient(top, rgba(167,199,225,1) 0%,rgba(124,176,222,1) 100%);
background-image:      -o-linear-gradient(top, rgba(167,199,225,1) 0%,rgba(124,176,222,1) 100%);
background-image:         linear-gradient(top, rgba(167,199,225,1) 0%,rgba(124,176,222,1) 100%);
-webkit-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(182,226,244,1)inset, 0px -16px 0px 0px rgba(99,165,219,1)inset;
-moz-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(182,226,244,1)inset, 0px -16px 0px 0px rgba(99,165,219,1)inset;
box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.15), 0px 1px 2px 0px rgba(0,0,0,0.15), 0px -2px 3px 0px rgba(182,226,244,1)inset, 0px -16px 0px 0px rgba(99,165,219,1)inset;
border: solid 1px #323D9F;
border-color: #323D9F #3365B4 #3365B4 #3365B4;
}

#alert{ /* alert box */
margin-left: 80%;
width: 200px;
background: #333;
box-shadow: inset 0 -1px 0 rgba(255,255,255,.4);
border: 1px solid;
color: #fff;
padding: 15px;
position: fixed;
_position: absolute;
text-shadow: 0 1px 0 rgba(0,0,0,.5);
animation: animate-bg 5s linear infinite;
-webkit-border-radius: 16px;
-moz-border-radius: 16px;
border-radius: 16px;
text-align: center;
font-weight: bold;
}


Here comes the jquery part, i added some validations and a post method handled by php
$(document).ready(function(){
// hide alert boxes

$('#alert').hide();

// empty() function used when there is nothing entered


   // lets declare the variables for easier usage
 
   var user = $('#user');
   var pass = $('#pass');
   var button = $('.button');
 
   // checking if there is nothing submitted
 
    $(button).click(function(){

if(user.val().length < 3){
$('#alert').fadeIn();
return false;
}
if(pass.val().length < 3){
$('#alert').fadeIn();
return false;
}

$.ajax({type:'POST', url: 'submit.php', data:$('#ContactForm').serialize(), success: function(response) {
    $('#ContactForm').find('.form_result').html(response);
}});

return false;

   });
 
 });


NOTE! The php script contains security holes, it is used just as an example for the tutorial.


We appreciate you for reading our post, but we think it will be better you like our facebook fanpage and also follow us on twitter below.
Follow @Superbaze_Ent
Are you an artiste? Do you want your music to go viral and reach a large number of audience? Promote your music on FLEXYHUBS by clicking here. You can also advertise your product or brand by clicking here.
Tweet
Php tutorial, Login script with Jquery Title : Php tutorial, Login script with Jquery
Description : View Demo   Download On today's  tutorial  were gonna build an  Php  and  Jquery  login script. To make it more easy i separated the art...
Rating : 5
Related Posts: php Tutorial

0 Response to "Php tutorial, Login script with Jquery"

← Newer Post Older Post ⇒ Home
Subscribe to: Post Comments (Atom)
Powered by Blogger.

MKRdezign

Archive

Technology

Breaking News

Populars

  • “I was referring to Duck head” — Dammy Krane comes for Tekno
    “I was referring to Duck head” — Dammy Krane comes for Tekno
    Dammy Krane has made it clear that he was referring to Tekno in His recent call out. Recall the drama between Dammy and Orezi started when ...
  • How to connect Your Payoneer account to a marketplace, network or Website
    How to connect Your Payoneer account to a marketplace, network or Website
    Are you a freelancer working on  Upwork  or  Fiverr ? Or perhaps you are selling on  Lazada  or  Wish ? Payoneer has partnered with leading ...
  • How to earn up to 10k with wema bank affliate program
    How to earn up to 10k with wema bank affliate program
    Love to make  #10 , 000 just referring friends. Got you good news. Introducing Alat.ng powered by Wema Bank. Nigeria's first truly digit...
  • Google CEO Pichai Hits Nigeria: Ready to Train 100,000 and Launch Range of Products
    Google CEO Pichai Hits Nigeria: Ready to Train 100,000 and Launch Range of Products
    In a company conference held in Lagos on Thursday, Sundar Pichai, the chief executive officer of Google Incorporated has said his firm would...
  • HOW MUCH DO FREELANCE WEB DESIGNERS CHARGE IN 2017?
    HOW MUCH DO FREELANCE WEB DESIGNERS CHARGE IN 2017?
    Expert Market finds out how much freelance web designers charge for their services and how to get a good deal for your business. Freelance W...
  • MTN Latest Revised 50MB, 150MB, 5GB Data Plans And Price
    MTN Latest Revised 50MB, 150MB, 5GB Data Plans And Price
    MTN revamped her daily data plan, and added some extra bundles to the list. This is the kind of development we want from our telcos, and MTN...
  • Latest Airtel 1GB For N300 Browsing Trick | How to Download Files With it
    Latest Airtel 1GB For N300 Browsing Trick | How to Download Files With it
    This  Airtel 1GB for N300 plan  has been hanging around for a while now, but only few people patronises it because it's a social plan th...
  • “I started growing breasts at age 7” — Busty Nigerian Lady shares Throwback Photo
    A Beautiful young Nigerian Facebook user, identified as Gloria E Okhani,has opened up about how she used to be extremely insecure about h...
  • WAEC Throws Light On Exam Remarking, Withheld And Outstanding Result
    WAEC Throws Light On Exam Remarking, Withheld And Outstanding Result
    The West African Examination Council (WAEC) has provided steps candidates who are not satisfied with the outcome of their result can apply f...
  • How To Make Money On Facebook 2017 :$50/Day Full Guide [Working+Proof]
    How To Make Money On Facebook 2017 :$50/Day Full Guide [Working+Proof]
    If you have above question in your mind than we have best answer here.. In this full guide you will get answer of every question like how to...
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy

Labels

  • Admission
  • Education
  • Entertainment Gist
  • Games
  • Gistnaija promo
  • Interviews
  • jquery tutorials
  • Music
  • Network
  • NEWS
  • php Tutorial
  • Python
  • Sports

  • Home
  • Home

Category

  • Admission
  • Education
  • Entertainment Gist
  • Games
  • Gistnaija promo
  • Interviews
  • jquery tutorials
  • Music
  • Network
  • NEWS
  • php Tutorial
  • Python
  • Sports

Facebook

Labels

  • Admission
  • Education
  • Entertainment Gist
  • Games
  • Gistnaija promo
  • Interviews
  • jquery tutorials
  • Music
  • Network
  • NEWS
  • php Tutorial
  • Python
  • Sports

Report Abuse

Top Featured

Search This Blog

Like on Facebook

Random Posts

Flickr

Social Share

Featured Posts

Recent Posts

Recent in Sports

Recent comments

Contact Form

Name

Email *

Message *

Label

Admission Education Entertainment Gist Games Gistnaija promo Interviews jquery tutorials Music Network NEWS php Tutorial Python Sports

Events

Videos

PLACE YOUR ADS HERE

Home of Aproko Entertainment

Contributors

  • Kedeayei
  • Teygah

Advertising

Pages

  • Home

Trending Posts

  • How to connect Your Payoneer account to a marketplace, network or Website
    Are you a freelancer working on  Upwork  or  Fiverr ? Or perhaps you are selling on  Lazada  or  Wish ? Payoneer has partnered with leading ...

Games

Blogs We Read

Labels

Entertainment Gist Network Education NEWS Sports Music php Tutorial jquery tutorials Interviews Python Admission Games Gistnaija promo
Copyright 2016 FLEXYHUBS INC - All Rights Reserved