简体   繁体   中英

Redirecting to another page and passing variables after clicking a submit button

I have script that has a form that is self submitting. And on that php script I insert the data into the database. I would like to store the last inserted id using mysql_insert_id() and use it in another form that is also self submitting.

What i want to do is after the submission of form 1, store the last inserted id, reload the page and pass the last inserted id in the url (reload using javascript). www.web.com?inserted_id=12312

and get that id and use it in another form.

How am i going to do that?

I can't load using jquery, here's my code in reloading the page:

window.location = '<?php echo $_SERVER["REQUEST_URI"]?>'

What i want to do is after the submission of form 1, store the last inserted id, reload the page and pass the last inserted id in the url.

---Use PHP sessions to save the last inserted id. then you can use it wherever you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM