Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. include "includes/init.php";
  5.  
  6. if(isset($_GET['id'])){
  7. $id = $_GET['id'];
  8. }else{
  9. header("Location: ./");
  10. die();
  11. }
  12.  
  13. if(isset($_SESSION['pseudo'])){
  14. $pseudo = $_SESSION['pseudo'];
  15. }else{
  16. header("Location: ./");
  17. die();
  18. }
  19.  
  20.  
  21.  
  22. $request = $bdd->query("SELECT * FROM `ticket` WHERE id = '".$id."';");
  23. $reponse = $request->fetch();
  24.  
  25. if($reponse['pseudo'] != $pseudo){
  26. header("Location: ./");
  27. die();
  28. }
  29.  
  30. echo $reponse['message_json'].'<hr>';
  31. $message = json_decode($reponse['message_json'], true);
  32. foreach ($message as $index) {
  33. echo $index."<br>";
  34. }
  35. $message_new = $_SESSION['pseudo']." : MESSAGE2";
  36. array_push($message, $message_new);
  37. $json = json_encode($message);
  38. echo $json;
  39. //$bdd->exec("UPDATE `ticket` SET `message_json`='".$json."' WHERE id = '".$id."';");
  40.  
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement