Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- $con = mysql_connect("localhost","root","");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("sandeep", $con);
- if(mysql_query("SELECT username FROM userlogin WHERE username = '".$_POST['uname']."' AND password = '".$_POST['pwd']."'"))
- {
- $result = mysql_query("SELECT * FROM userlogin");
- echo "<table>";
- for($i = 0;$i < mysql_num_fields(); $i++)
- echo "<th>".mysql_field_name($result,$i)."</th>";
- while($row = mysql_fetch_array($result))
- {
- echo "<tr>";
- echo "<td>".$row['username']."</td>";
- echo "<td>".$row['password']."</td>";
- echo "</tr>";
- }
- echo </table>;
- } else
- echo "Login denied";
- ?>
- <body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement