<?php $con=mysql_connect("localhost","username","password"); if(!$con) { die("connectivity error".mysql_error()); } mysql_select_db("cool",$con); if(isset($_POST['ok'])) { $s="select * from login where username='$_POST[uname]' and password='$_POST[pwd]'"; $name=mysql_query($s) or die(mysql_error()); $i=0; while($row=mysql_fetch_array($name)) { $i++; } if($i>0) { echo("hi"); } else { echo "<script language='javascript'>"; echo "alert('sorry you cant come to me');"; echo "</script>"; } } ?> <html> <head></head> <body> <form action="" method="post"> <input type="text" name="uname"/> <input type="text" name="pwd"/> <input type="submit" name="ok" value="Login"/> </form> </body> </html> </body> pls give the correct coding
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)