Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1.  <html>
  2.    <body>
  3.          
  4.        <?php //echo $_REQUEST["uname"]; ?>
  5.        <?php //echo $_REQUEST["pwd"]; ?>
  6.        <?php
  7.  
  8.               $con = mysql_connect("localhost","root","");
  9.         if (!$con)
  10.         {
  11.             die('Could not connect: ' . mysql_error());
  12.         }
  13.         mysql_select_db("sandeep", $con);
  14.         $post_uname = $_POST['uname'];
  15.         $post_pwd = $_POST['pwd'];
  16.  $result=mysql_query("select * from userlogin where username = '$post_uname' && password = '$post_pwd' ");
  17.         mysql_close($con);
  18.         $result2=mysql_query("select * from userlogin");
  19.         if(mysql_num_rows($result)>0)
  20.           {
  21.               echo "<table><tr>";
  22.               for($i=0;$i<mysql_num_rows($result2);$i++)
  23.                {
  24.                   echo "<th>".mysql_field_name($result,$i)."</th>";
  25.                  
  26.                }  
  27.                echo "</tr>";
  28.               while($row=mysql_fetch_array($result2))
  29.                {
  30.                  echo "<tr>";
  31.                  echo "<td>".$row['username']."</td>";
  32.                  echo "<td>".$row['password']."</td>";
  33.                  echo "</tr>";
  34.                  
  35.                }
  36.                echo </table>;
  37.           }
  38.         ?>
  39.        
  40.    <body>
  41.  </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement