Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. if(isset($_SESSION['USER_ID']))
  5. {
  6. if ($_SESSION['RUOLO'] == 'N' )
  7. {
  8. if (isset($_POST['submit']))
  9. {
  10. include 'FILE_DI_CONNESSIONE.php';
  11.  
  12. $id = $VARIABILE_FILE_DI_CONNESSIONE->real_escape_string($_POST['id']);
  13. $role = $VARIABILE_FILE_DI_CONNESSIONE->real_escape_string($_POST['role']);
  14. $commerciali = $VARIABILE_FILE_DI_CONNESSIONE->real_escape_string($_POST['commerciali']);
  15.  
  16. $query = mysqli_query($VARIABILE_FILE_DI_CONNESSIONE, "UPDATE tabella SET role='$role', commerciali='$commerciali' WHERE id = ".$_SESSION['USER_ID']);
  17.  
  18. if( $query )
  19. {
  20. if(isset($_POST['role']))
  21. {
  22. $role = ($_POST['role']);
  23. echo "ok";
  24. }
  25.  
  26. else
  27. {
  28. echo "errore";
  29. }
  30. }
  31.  
  32.  
  33. }
  34. }
  35.  
  36. }
  37. ?>
  38.  
  39.  
  40. <form method="post" action="n.php">
  41. <input class="form-control" name="id" value="<?php echo $_SESSION['USER_ID']; ?>"><br>
  42.  
  43. <label>Privacy</label>
  44. <input class="form-control" type="checkbox" value="S" required name="role" placeholder="<?php echo $_SESSION['RUOLO']; ?>"><br>
  45.  
  46. <label>Termini e Condizioni</label>
  47. <input class="form-control" type="checkbox" value="S" name="commerciali" placeholder="<?php echo $_SESSION['RUOLO']; ?>"><br>
  48.  
  49.  
  50.  
  51. <input class="btn btn-primary" name="submit" type="submit" value="Register..."><br>
  52. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement