View difference between Paste ID: HQxYgF1C and 3dmKhMv1
SHOW: | | - or go back to the newest paste.
1
<?php
2
3
session_start();  
4
5
    if (!isset($_SESSION['login'])) { 
6
7
       header ('Location: index.php'); 
8
9
       exit();  
10
11
    } 
12
	include_once('config.php');
13
	  echo '<br/>';
14
	  if ( $pseudo =='admin') 
15
	  
16
	  {$auteur=$_GET['pseudo'];
17
	  $titre=$_GET['titre'];
18
	  $description=$_GET['description'];
19
	  $nid=$_GET['id'];	  
20
	      if (isset($_POST['go']) && $_POST['go']=='Envoyer la reponse') 
21
		  {       include_once('config.php');  
22
		  if (!isset($_POST['reponse'])) 
23
		  {           $erreur = 'Les variables nécessaires au script ne sont pas définies.';      
24
		  }        
25
		  else {           if (empty($_POST['reponse'])) {  
26
		  $erreur = 'Au moins un des champs est vide.';        
27
		  }                    else { 		
28
		  $rep = $_POST['reponse'];                     
29
		  $sql = 'mysql_query("UPDATE news SET reponse='.$rep.' WHERE id='.$nid.'");';  
30
		  mysql_query($sql) or die('Erreur SQL !'.$sql.'<br />'.mysql_error());
31
		  mysql_close();     
32
		  header('Location: ok.php');                        exit();           }        }      }
33
		  echo ''.$auteur.'<br/>'.$titre.'<br/>'.$description.'<br/> id : '.$nid.'';    ?>  
34
  <html>   
35
 <head>    
36
<title>R&eacute;ponse au ticket de <?php echo ''.$auteur.'';?></title>
37
<br/>   
38
 </head>        
39
 <body>	Description du ticket : <?php echo ''.$description.'';?>         
40
 <form action="reponse.php method="post">
41
    <table>    <tr><td>    
42
<span class="gras">r&eacute;ponse :</span>
43
    </td><td>    
44
<textarea name="reponse" cols="50" rows="10">
45-
<?php if (isset($_POST['reponse'])) echo htmlentities(trim($_POST['reponse'])); ?></textarea>
45+
<?php if (isset($_POST['reponse'])) {echo htmlentities(trim($_POST['reponse']));} ?></textarea>
46
 </td></tr><tr><td align="right">    <input type="submit" name="go" value="Envoyer la reponse">   
47
 </td></tr></table>    </form>
48
    <?php       if (isset($erreur)) {echo '<br /><br />',$erreur; }    ?>    
49
</body>   
50
 </html>