Advertisement
Guest User

Untitled

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