Guest User

Untitled

a guest
Apr 30th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. $user="logicsequence";
  2. $password="132435~~";
  3. $dbname="logicsequence";
  4.  
  5. $mysqli = new mysqli('localhost', $user, $password, $dbname);
  6.  
  7. //save all the notes and hiddens
  8. if($_POST['notes']==1){
  9. foreach ($_POST as $k => $a) {
  10. if($k!="notes"){
  11. if(!preg_match("/check/", $k)){
  12. $a = $mysqli->real_escape_string($a);
  13. $result = $mysqli->query("UPDATE `contacts` SET `notes`='$a', valid='1' WHERE `id`='$k'");
  14. }
  15. if(preg_match("/check/", $k)){
  16. $k=str_replace("check", "", $k);
  17. $result = $mysqli->query("UPDATE `contacts` SET `valid`='0' WHERE `id`='$k'");
  18. }
  19. }
  20. }
  21. }
Add Comment
Please, Sign In to add comment