Necesito agregar un texto que defino en un textarea que esta al final del codigo pero al querer ingresarlo por primera vez me sale variable indefinida como hago para corregir esto adjunto el codigo
<?php
session_start();
if (!isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] != 1 or
$_SESSION['user_permision'] != "Administrador")
{
header("location: login.php");
exit;
}
require_once ("config/db.php");
require_once ("config/conexion.php");
$active_ticket="active";
$title="Prestamos | Simple Stock";
$Nticket= $_GET['Nticket'];
$incidencia= $_GET['incidencia'];
$tema= $_GET['tema'];
$detalle= $_GET['detalle'];
$firstname= $_GET['firstname'];
$text = $_POST['editor'];
?>
<html>
<head>
<?php include("head.php");
include("navbarhelp.php");?>
<script src="ckeditor/ckeditor.js"></script>
</head>
<body>
<div class="subject">Asunto:<strong><?php echo $tema; ?></strong></div>
<div id="ticketThread">
<table class="thread-entry message" cellspacing="0"
cellpadding="1"width="800" boder="0">
<tbody>
<tr>
<th>
<div>
<span class="textra"></span>
<span><?php echo $firstname; ?></span>
</div>
</th>
</tr>
<tr>
<td class="thread-body"><div><?php echo $detalle ?></div></td>
</tr>
</tbody>
</table>
<table class="thread-entry response" cellspacing="0" cellpadding="1"
width="800" border="0">
<tbody>
<tr>
<th>
<div>
Respuesta <span class="textra"></span>
<span></span>
</div>
</th>
</tr>
<tr><br>
<td class="thread-body"><br><div><?php echo $text ?><br>
</div></td></tr>
</tbody></table></div>
<form action="respuestas.php?Nticket=<?php echo $Nticket?>&incidencia=<?
=$incidencia?>&tema=<?=$tema?>&detalle=<?=$detalle?>&firstname=<?
=$firstname?>"
method="POST">
<textarea class="ckeditor" name="editor"></textarea>
<input type="submit" value="Respuesta">
</form>
</body>
<?php
if(isset($_POST['editor'])){
$text = $_POST['editor'];
$query = mysqli_query($con, "UPDATE ticket SET Respuesta='".$text."'
WHERE Nticket='".$Nticket."'");
}
?>
esto es antes de ingresar un valor
y despues de ingresar un valor en el textarea