Guest User

Untitled

a guest
Apr 20th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.69 KB | None | 0 0
  1. <?php
  2.  
  3. $theDate = date("F j, Y");
  4. $IPAddress = $_SERVER["REMOTE_ADDR"];
  5. $SQLcon = mysql_connect("localhost","root","root");
  6. $SQLVersion = mysql_get_server_info($SQLcon);
  7. mysql_select_db("lab2", $SQLcon);
  8. $twoNames = mysql_query("SELECT  `name` FROM  `lab2`  LIMIT 0,2");
  9. var_dump($twoNums);
  10. while ($row = mysql_fetch_array($twoNames, MYSQL_NUM)) {
  11.     $nameone = $row[0];
  12.     $nametwo = $row[1];
  13. }
  14.  
  15. $rec5query = mysql_query("SELECT `regnum` FROM  `lab2`  LIMIT 0,2");
  16. $twoNums = mysql_fetch_array($rec5query, MYSQL_BOTH);
  17.  
  18. echo " <table border='1'>
  19. <tr>
  20. <td>Rectangle 1 <br> Hamish Jefford 10166503 $theDate</td>
  21. <td>Rectangle 2 <br> $IPAddress </td>
  22. </tr>
  23. <tr>
  24. <td>Rectangle 3 <br> $SQLVersion </td>
  25. <td>Rectangle 4 <br> $nameone $nametwo </td>
  26. </tr>
  27. <tr>
  28. <td>Rectangle 5 <br> $twoNums[0] <br> $twoNums[1] </td>
  29. <td>Rectangle 6 <br> Enter a username: <br>
  30. <form name=\"input\" action=\"labtwo.php\" method=\"post\">
  31. <input type=\"text\" name=\"usrNoInput\" method=\"post\"/>
  32. <input type=\"submit\" name=\"submit\"/>
  33. </form>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td>Rectangle 7 <br> Input new user's name: <br>
  38. <form name=\"NewUsr\" action=\"labtwo.php\" method=\"post\">
  39. <input type=\"text\" name=\"newNameUsr\" method=\"post\"/>
  40. <input type=\"submit\" name=\"submit\"/>
  41. </form>
  42. </td>
  43. <td>Rectangle 8 <br>
  44. <form name=\"login\" action=\"labtwo.php\" method=\"post\">
  45. Username: <input type=\"text\" name=\"usrNameIn\" method=\"post\"/>
  46. <br>
  47. Password: <input type=\"text\" name=\"usrPassIn\" method=\"post\"/>
  48. <input type=\"submit\" name=\"submit\"/>
  49. </form>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td>Rectangle 9 <br> Pass yes/no? </td>
  54. <td>Rectangle 10 <br>
  55. hello hamish!!!!!!!!
  56. </td>
  57. </tr>
  58. </table> ";
  59. ?>
Add Comment
Please, Sign In to add comment