Friday, 17 February 2017

Login validataion in PHP




<?php
include"connect.php";
$un=$_POST['txtuname'];
$up=$_POST['txtpass'];
//echo "$un</br>$up</br>";


$res=pg_query($con,"select count(*) from Users where uname='$un' and upass='$up'");

$r=pg_fetch_array($res);
if($r[0]==1)
{
session_start();
$_SESSION['unm']=$un;
$_SESSION['ups']=$up;

 echo "<script type='text/javascript'>";
                echo "if(confirm('Login Successfully'))document.location='home.html';else document.location='home.html';";
                echo "</script>";

}
else
{

 echo "<script type='text/javascript'>";
                echo "if(confirm('Username or password doesnot match'))document.location='home.html';else document.location='home.html';";
                echo "</script>";

}


?>

23 comments:

  1. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.php training in chennai

    ReplyDelete
    Replies
    1. Thanks for your code. I hope this code is helpful to create login validation.

      Software Testing Training in Chennai
      Software Testing Course in Chennai

      Delete
    2. IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes. IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble.Final Year Projects for CSE

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining .

      Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

      The Angular Training covers a wide range of topics including Angular Directives, Angular Services, and Angular programmability.Angular Training

      Delete
  2. thank u blogger

    ReplyDelete
  3. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here. java training in chennai

    ReplyDelete
  4. Appreciation for really being thoughtful and also for deciding on certain marvelous guides most people really want to be aware of.

    AWS Training in Chennai

    ReplyDelete
  5. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.
    rpa training in chennai

    ReplyDelete
  6. Very wonderful article! I read your post regularly. It is very interesting and very helpful for improve myself. Please posting.....
    PHP Training Center in Bangalore
    PHP Course in Bangalore
    PHP Training in Nolambur
    PHP Training in Vadapalani
    PHP Training in Kandanchavadi

    ReplyDelete
  7. Your blog information are really creative and useful for the readers.I ever read such kind of nice article yet.
    hope you will add more innovative ideas on your post.
    cloud training in chennai
    Cloud Computing Courses in Adyar
    Cloud Computing Courses in Tambaram
    Hadoop Training in Chennai
    Selenium Training in Chennai
    JAVA Training in Chennai

    ReplyDelete
  8. Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
    Selenium online training
    Selenium certification training
    Selenium online course
    Selenium training course

    ReplyDelete
  9. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
    Digital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery

    ReplyDelete
  10. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them. keep it up
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete

Note: only a member of this blog may post a comment.