我想在提交此表单后保持相同的模式
generateBarcode.php:
<form action="savegenarateBarcode.php?id=<?php echo $d1; ?>" method="post">
savegenerateBarcode.php:
<?php
try {
session_start();
include('../connect.php');
$d1 = $_GET['id'];
$b = $_POST['serialnumber'];
$sqlm = "select *from product_item where serialnumber='".$b."'";
$query = $db->prepare($sqlm);
$user_array = $query ->execute();
}
提交此表单后如何保持 generateBarcode.php(modal) 不变?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
I think you should use
ajaxbecause the formsubmitmethod reload the page.var id = '<?php echo $d1; ?>'; $("#submit").click(function(){ $.ajax({ type: 'GET', url: "savegenarateBarcode.php", data:`id=${id}` success:function(data){ alert(data); } }); return false; });