Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include "includes/init.php";
- if(isset($_GET['id'])){
- $id = $_GET['id'];
- }else{
- header("Location: ./");
- die();
- }
- if(isset($_SESSION['pseudo'])){
- $pseudo = $_SESSION['pseudo'];
- }else{
- header("Location: ./");
- die();
- }
- $request = $bdd->query("SELECT * FROM `ticket` WHERE id = '".$id."';");
- $reponse = $request->fetch();
- if($reponse['pseudo'] != $pseudo){
- header("Location: ./");
- die();
- }
- echo $reponse['message_json'].'<hr>';
- $message = json_decode($reponse['message_json'], true);
- foreach ($message as $index) {
- echo $index."<br>";
- }
- $message_new = $_SESSION['pseudo']." : MESSAGE2";
- array_push($message, $message_new);
- $json = json_encode($message);
- echo $json;
- //$bdd->exec("UPDATE `ticket` SET `message_json`='".$json."' WHERE id = '".$id."';");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement