Advertisement
Guest User

Untitled

a guest
Oct 11th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php
  2.  
  3. include "connetti.php";
  4.  
  5. $giorno=date(j);
  6. $mese=date(n);
  7. $anno=date(Y);
  8. $Data=$anno.'-'.$mese.'-'.$giorno;
  9.  
  10.  
  11. $user=htmlspecialchars( $_REQUEST["user"]);
  12. $password=htmlspecialchars( $_REQUEST["pass"]);
  13.  
  14. $query = "SELECT * FROM impiegato WHERE (impiegato.username = '".$user."') AND (impiegato.admin = 0) AND (impiegato.password = '".$password."')";
  15.  
  16. $result = mysql_query($query);
  17.  
  18. if(mysql_num_rows($result) > 0) {
  19.  
  20.  
  21. foreach($_REQUEST['commessa'] as $v){
  22.  
  23. if($v[0] != "null"){
  24. $query = "inserto into commessa(username,nomecommessa,commessa1,visibile,data) values('".$user."','".$v[0]."',".$v[1].",0,".$Data.")";
  25.  
  26. mysql_query($query);
  27.  
  28. $queryfuuu = "select * from commessa where nomecommessa='".$v[0]."' and username='".$user."'";
  29. $rr = mysql_query($queryfuuu);
  30. $rr = mysql_fetch_assoc($rr);
  31. $Query1 = "insert into impiegato_has_commessa(commessa_idcommessa,impiegato_username) values (".$rr['idcommessa']." , '".htmlspecialchars($user)."');";
  32. mysql_query($Query1);
  33.  
  34. }
  35.  
  36. }
  37. echo "eseguito con successo";
  38. }
  39. else {
  40. print("Login invalido.");
  41. exit;
  42. }
  43.  
  44.  
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement