Pass Dreamweaver PHP Insert Form data to new page
Posted on 2012-03-16
Using Dreamweaver and PHP.
On page one, I have an Insert Form with one Field (LastName) which inserts into a SQL database. The SQL database has an auto-increment ID field.
When I click on Submit (thereby inserting the data into the database), I want a new page to open up and display the value of the ID field.
I have read numerous posts online suggesting use of mysql_insert_id(), etc., but no matter where I put that function, I get a blank field on the next page.
I have a session variable sessMemberNumber, so I tried
<?php $_SESSION['sessMemberNumber'] = mysql_insert_id();?>
I tried putting this on page 1 after the INSERT query. I tried putting it on page 2 after the Start Session command.
Nothing seems to work.
Can someone give me the simplest possible code to perform this task? And exactly where to place it in my code?
NOTE: I have successfully used User Authentication forms to send session variables from one page to another, but can't figure out how to do this with an INSERT Form.