Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <form action="query.php" method="post" />
  2. Query<br><textarea cols="30" rows="8" name="sqlquery"></textarea><br>
  3. Password<br><input type="password" name="userpass" /><br>
  4. <input type="submit" />
  5. </form>
  6.  
  7. <?php
  8. $query = " " .  $_POST['sqlquery'] . " "pas;
  9. $userpass = $_POST['userpass'];
  10. $mysql_host = "*******";
  11. $mysql_database = "*******";
  12. $mysql_user = "*******";
  13. $mysql_password = "*******";
  14. $con = mysql_connect($mysql_host, $mysql_user, $mysql_password);
  15. mysql_select_db ($mysql_database, $con);
  16.         $result = mysql_query($query);
  17. if ($userpass == '*******')
  18. {
  19. echo "<table border='1'>";
  20. echo "<tr><th>First</th><th>Last</th><th>Email</th></tr>";
  21. while($row = mysql_fetch_array($result))
  22.   {
  23.   echo "<tr><td>";
  24.   echo $row['firstName'];
  25.   echo "</td> <td> ";
  26.   echo $row['lastName'];
  27.   echo "</td><td>";
  28.   echo $row['emailAddr'];
  29.   echo "</td></tr>";
  30.   }
  31. echo "</table>";
  32. echo "<br>" . $result;
  33. mysql_close($con);
  34. }
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement