View difference between Paste ID: qyjUzZ8e and HQxYgF1C
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') 
14+
      $auteur=$_GET['pseudo'];
15-
	  
15+
      $titre=$_GET['titre'];
16-
	  {$auteur=$_GET['pseudo'];
16+
      $description=$_GET['description'];
17-
	  $titre=$_GET['titre'];
17+
	if (isset($_POST['go']) && $_POST['go']=='Envoyer la reponse') 
18-
	  $description=$_GET['description'];
18+
19-
	  $nid=$_GET['id'];	  
19+
20-
	      if (isset($_POST['go']) && $_POST['go']=='Envoyer la reponse') 
20+
21
		  }        
22
		  else {           if (empty($_POST['reponse'])) {  
23
		  $erreur = 'Au moins un des champs est vide.';        } 
24
		  else { 		
25
		  $rep = $_POST['reponse'];          
26-
		  $erreur = 'Au moins un des champs est vide.';        
26+
echo 'reponse :'.$_POST['reponse'].'<br/>id : '.$_POST['id'].'';
27-
		  }                    else { 		
27+
		  
28-
		  $rep = $_POST['reponse'];                     
28+
  exit();           }        }      }
29-
		  $sql = 'mysql_query("UPDATE news SET reponse='.$rep.' WHERE id='.$nid.'");';  
29+
		  echo ''.$auteur.'<br/>'.$titre.'<br/>'.$description.'<br/> id : '.$nid.'';    ?> 
30-
		  mysql_query($sql) or die('Erreur SQL !'.$sql.'<br />'.mysql_error());
30+
		  <html>    <head>    <title>R&eacute;ponse au ticket de <?php echo ''.$auteur.'';?></title><br/>              </head>    
31-
		  mysql_close();     
31+
		  <body>	Description du ticket : <?php echo ''.$description.'';?>       
32-
		  header('Location: ok.php');                        exit();           }        }      }
32+
		  <form action="reponse.php" method="post">    <table>    <tr><td> 
33-
		  echo ''.$auteur.'<br/>'.$titre.'<br/>'.$description.'<br/> id : '.$nid.'';    ?>  
33+
<INPUT TYPE="HIDDEN" NAME="id" VALUE="<?php $_GET['id'] ?>" /> 
34-
  <html>   
34+
35-
 <head>    
35+
 </td><td>
36-
<title>R&eacute;ponse au ticket de <?php echo ''.$auteur.'';?></title>
36+
<textarea name="reponse" cols="50" rows="10"><?php if (isset($_POST['reponse']))
37-
<br/>   
37+
{ echo htmlentities(trim($_POST['reponse']));} ?>
38-
 </head>        
38+
</textarea>
39-
 <body>	Description du ticket : <?php echo ''.$description.'';?>         
39+
</td></tr><tr><td align="right">    
40-
 <form action="reponse.php method="post">
40+
<input type="submit" name="go" value="Envoyer la reponse"> 
41-
    <table>    <tr><td>    
41+
</td></tr></table>    
42
</form>    
43-
    </td><td>    
43+
<?php if (isset($erreur)){echo '<br /><br />',$erreur;}    ?>   
44-
<textarea name="reponse" cols="50" rows="10">
44+
 </body>    </html>