I have two PHP files, index.php and insert.php.
- index.php- a form and a button to send data
- insert.php- receives the values of the form to insert them into a database, and it works.
When I redirect to the index.php, it shows a successful message.
I have this code in index.php to show the message:
<?php
   $mensaje=$_GET['mensaje'];
   if($mensaje=="")
      {
      }
   else
      {
         echo "¡Registro exitoso!";
      }
?>
but when I open it the first time, it shows me:
Notice: Undefined index: mensaje in C:\xampp\htdocs\..\index.php on line 41
How could I show the message ONLY after the insert?
 
     
     
    