we are working with php session data, but the data is not being stored in the database
login.php
<h2>Welcome</h2> <form action = "Customer.php" method = "POST"> Customer Name:<input type = "text" name="customerName"> <input type = "submit" name = "submit"> </form> Customer.php
<?php session_start(); #include("Connection.php); if (isset($_POST['submit'])) { $name = $_POST['customerName']; $_SESSION['user'] = $name; } if (isset($_SESSION['user'])) { echo "Hello {$_SESSION['user']}, welcome to starbucks!"; } else { echo "walang tao"; $sql="INSERT INTO `customer`.`people` ('ID', `NAME`) VALUES ('','$name')"; mysql_query($sql); ?> <a href = "logout.php">Logout</a> and logout.php
<?php session_start(); session_destroy(); ?> <a href = "index.php">Click me to return to login </a> please tell me what's wrong
elseblock, there is still no session data because you're depending onisset($_POST['submit'])to get something assigned to your session variable.