I need to pass the sessions user name (that they have logged in with) which is an email! I need to pass this to a separate page and output it in a table to represent a review submitted
$_SESSION['name'] = $_POST['name']; - sends page to login in when refreshed $name = ['name'] - sends page back to login
<!-- logged in user information -->
<?php if (isset($_SESSION['email'])) : ?>
<p>Welcome you are logged in as: <strong><?php echo $_SESSION['email']; ?></strong></p>
the 'email' needs passing across from the code above 'index.php' to the code below 'reviews.php'
<p>
<input name="product_id" value="<?php echo "$var" ?>" readonly> <!-- get value from previous page-->
<input name="track_name" value="<?php echo "$var_value" ?>" readonly> <!-- get value from previous page-->
<input name="track_name" value="<?php echo "EMAIL_HERE" ?>" readonly> <!-- get value from previous page-->
<!-- get value from previous page-->
<input type="Submit" name="Submit" value="Submit"></p>
As this is an assignment I can only use PHP MYSQL HTML CSS
I would like the user name (email) to be echo out in a table as $var and $var_value is, they should then all print out beside each other in a form
UPDATE using this code I have managed to now get the variable value across but cannot insert it to the DB
$email = $_SESSION['email'];
$sql = "INSERT INTO reviews (rating, review, track_name, product_id, email) values('$rate', '$text', '$track', '$artist', '$email')";
``" readonly>```
so the update is how can I now get this inserted to my database?