to descibe simply, I've 3 php files- form.php, save.php & confirm.php
form.php is a general form having
<form id="form" name="form" method="post" action= 'save.php' ><form>
save.php is for updating SQL by insert command
$sql = "INSERT INTO database (name, age, sex, id) VALUES ('$name', '$age', '$sex', '$id')";
I'm also using header same page to redirect after save
header('Location: confirm.php');
Now what I'm expecting When people submit form, data will save to SQL & redirect to confirm.php where they can see their submitted data.
Its redirecting after save but I can't figure out the way to getting submitted data on confirm.php , I've tried to use $_SESSION but page is getting blank. I'd be great If I can pass submitted form's $id
to confirm.php with $_SESSION or someting so can I can call $id
from confirm.php & get the data. Please suggest how to do that.
Get inserted ID through $id = mysqli_insert_id(); and pass header('Location: confirm.php?id='.$id);
and get details through this id.
in confirm.php $_REQUEST['id'];
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments