0

but wanted to know what is wrong with my PHP statement, I wrote it to protect from SQL Injection attacks. It is storing variables from the previous page. Below is the error I get and I am not sure why?

Notice: Undefined index: name in C:\xampp\htdocs\westend\selectDate.php on line 10

Notice: Undefined index: email in C:\xampp\htdocs\westend\selectDate.php on line 11

This is my code, I do not get an error for production

<?php
session_start();
$host='localhost';
$user='root';
$pass='';
$db='theatre_booking';

$con= mysqli_connect($host,$user,$pass,$db);

$name= mysqli_real_escape_string($con, $_SESSION['name']);
$email = mysqli_real_escape_string($con, $_SESSION['email']);

$title = $_POST['production'];
$_SESSION["production"]=$title;



?>
user5647516
  • 1,083
  • 1
  • 9
  • 19

0 Answers0