6. Write a PHP Script create login form and validate it (Use database and Sticky form concept)
<html>
<head>
<title>Sticky Form</title>
</head>
<body>
<form action="<?php
echo $_SERVER['PHP_SELF']?>" method=post>
<input type=text
name=txtuname value="<?php if(isset($_POST['txtuname']))echo
$_POST['txtuname'];?>" ></br>
<input type=password
name=txtupass value="<?php if(isset($_POST['txtupass']))echo
$_POST['txtupass'];?>" ></br>
<input type=submit
value="Login" name=submit>
<?php
if(isset($_POST['submit']))
$nm=$_POST['txtuname'];
$ps=$_POST['txtupass'];
$con=mysql_connect("localhost","root","rsb");
mysql_elect_db("slip6db",$con);
$result=mysql_query("select
* from login where uname='$nm' and upass='$ps'");
$flag=0;
while($row=mysql_fetch_array($result))
{
$flag++;
}
if($flag==1)
echo
"Login validated";
else
echo
"username or password invalid";
?>
</body>
</html>
That's a Great Article and more useful for anyone.Thanks for sharing...
ReplyDeletePHP Training course in chennai
Mereka memberikan beberapa jenis promosi serta bonus menarik. Hingga banyak beberapa pengagum domino online yang tertarik untuk bermain judi dalam situs perjudian mereka.
ReplyDeleteasikqq
dewaqq
sumoqq
interqq
pionpoker
bandar ceme terpercaya
hobiqq
paito warna
forum prediksi
I would like to thank you so much for sharing with us and I have many ideas after visiting your post. Well done... good jb
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
Very often client faces some typically common issues like he/she isn’t prepared to open QuickBooks Technical Support Number package, it is playing terribly slow, struggling to set up and re-install, a challenge in printing checks or client reports. good job
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai