[英]how to redirect page to last incremented id after submitting form
這是我的代碼}
echo "<script type='text/javascript'>alert('Successfully Register!');</script>";
echo "<script>document.location='detail.php?id=$id'</script>";
您可以使用http://php.net/manual/en/pdo.lastinsertid.php
將此分配給$id
,您的腳本應按預期工作。
得到了解決方案
enter code here
"header('位置:details.php?id='.mysqli_insert_id($con)"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.