Advertisement
Guest User

Untitled

a guest
Aug 29th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <html>
  2. <head>
  3. <?php $userquery ?>'s Profile
  4.  
  5. </head>
  6. <body>
  7.  
  8. <?php
  9. //check for a form submission
  10. if (isset($_GET['username'])) {
  11. $username = $_GET['username'];
  12. }
  13. mysql_connect("localhost","root","","socialnetwork") or die ("Could not connect to the server!");
  14. $userquery = mysql_query("SELECT Username FROM users WHERE socialnetwork") or die ("The query could not be completed. Please try again");
  15. if (mysql_num_rows($userquery) != 1) {
  16. die ("That username is not valid. Please try again!");
  17. }
  18. while($row = mysql_fetch_array($userquery, MYSQL_ASSOC)) {
  19. $username = $row['username'];
  20. }
  21.  
  22. ?>
  23.  
  24. <h2><?php echo $userquery; ?>'s Profile</h2><br />
  25. <table>
  26. <tr><td>Username:</td><td><?php echo $username; ?></td></tr>
  27. </table>
  28.  
  29.  
  30.  
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement