post variable to another page without form
Posted: Fri Oct 18, 2013 6:18 am
I have a form where the user submits data and when the form is submitted it runs the script info.php which is in the form action submits the data to the database. In the script I have used the last insert id function and set it to the variable $details. What I want to do is post the variable $details back to the form and echo it out on screen. When the user submits the form and info.php is executed it displays an alert box with the message Details Added and when the user clicks ok it displays another message saying "Do you want to close this tab?" and when the tab is closed I want the value for $details echoed on screen.
So far I have tried using sessions, so on the submission form I have:
session_start() at the top and to echo the variable I have:
<label>Job Reference Number:</label> <?php echo $_SESSION[$ref]; ?>
And in info.php I have session_start() at the top and to post the variable to the submission form I have:
$_SESSION[$details] = $ref;
Any suggestions would be greatly appreciated thanks
So far I have tried using sessions, so on the submission form I have:
session_start() at the top and to echo the variable I have:
<label>Job Reference Number:</label> <?php echo $_SESSION[$ref]; ?>
And in info.php I have session_start() at the top and to post the variable to the submission form I have:
$_SESSION[$details] = $ref;
Any suggestions would be greatly appreciated thanks