Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.27 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>
  4. wedstrijd aanwezigheid
  5. </title>
  6. </head>
  7. <body>
  8. <form  name ="johanDeMoor" method ="Post" action ="klikding.php">
  9. <table>
  10. <tr>
  11. <td>
  12. Johan De Moor
  13. </td>
  14. <td>
  15. <input type="radio" name="johandemoor" value="aanwezig" /> aanwezig
  16. </td>
  17. <td>
  18. <input type="radio" name="johandemoor" value="afwezig" /> afwezig
  19. </td>
  20. <td>
  21. <input type = "Submit" name = "Submit" value = "keuze bevestigen" />
  22. </td>
  23. </tr>
  24. </table>
  25. </form>
  26. <?php
  27.  
  28. /**
  29.  * @author johan de moor
  30.  * @copyright 2010
  31.  */
  32.  
  33. $link = mysql_connect('localhost', 'root', '')
  34.     or die(print 'Could not connect: ' . mysql_error());
  35. echo 'Connected successfully';
  36. mysql_select_db('voetbal') or die(print 'Could not select database');
  37. echo "<br />";
  38. $selected_radio = $_POST['johandemoor'];
  39. $username = "johan";
  40. if (isset($_POST['Submit']))
  41. {
  42.     $selected_radio = $_POST[''];
  43. }
  44. $query = "INSERT INTO login (username, password, ID, aanwezig) VALUES ('".$username."', '', '','". $selected_radio."')";
  45.  
  46. mysql_query($query) or die(print mysql_error());
  47. $queryaanwezig = "SELECT aanwezig FROM login WHERE username = {'$username'} && password = '{$password}' ";
  48. $aanwezig = mysql_query($queryaanwezig);
  49.  
  50. echo $aanwezig;
  51. // Echoes: string
  52. echo gettype($array['user_id']);
  53. ?>
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement