Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 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. $result=mysql_query("select * from userlogin where username=\'$_POST['uname']\'&&password=\'$_POST['pwd']\'");
  15.         mysql_close($con);
  16.         $result2=mysql_query("select * from userlogin");
  17.         if(mysql_num_rows($result)>0)
  18.           {
  19.               echo "<table><tr>";
  20.               for($i=0;$i<mysql_num_rows($result2);$i++)
  21.                {
  22.                   echo "<th>".mysql_field_name($result,$i)."</th>";
  23.                  
  24.                }  
  25.                echo "</tr>";
  26.               while($row=mysql_fetch_array($result2))
  27.                {
  28.                  echo "<tr>";
  29.                  echo "<td>".$row['username']."</td>";
  30.                  echo "<td>".$row['password']."</td>";
  31.                  echo "</tr>";
  32.                  
  33.                }
  34.                echo </table>;
  35.           }
  36.         ?>
  37.        
  38.    <body>
  39.  </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement