HTML
<link rel="stylesheet" type="text/css" href="<?php echo CSS_URL ?>modal.css" />
<form id="postinfo" action="" method="POST">
<input type="hidden" name="technician" value="<?php echo $technician; ?>">
<input type="hidden" name="custnum" value="<?php echo htmlentities(serialize($customerNum)); ?>">
<input type="hidden" name="meternum" value="<?php echo htmlentities(serialize($meterNumbers)); ?>">
<input type="hidden" name="remcred" value="<?php echo htmlentities(serialize($remCreditArray)); ?>">
<input type="hidden" name="visitdate" value="<?php echo htmlentities(serialize($dateArray)); ?>">
<a href ="<?php echo PROCESS_URL; ?>create_maint_token_excel.php" onclick="document.getElementById('postinfo').submit();">
<img src="<?php echo IMAGE_URL ?>Excel.png" name="Print Excel" title="Print Excel" alt="Print Excel" /></a>
</form>
PHP
$customerNum = unserialize($_POST['custnum']);
$meterNumbers = unserialize($_POST['meternum']);
$remCreditArray = unserialize($_POST['remcred']);
$dateArray = unserialize($_POST['visitdate']);
$technician = ($_POST['technician']);
我尝试了多种将这些数组发布到 php 页面的方法,但页面一直告诉我, 和custnum
是meternum
未定义的。remcred
visitdate
我尝试使用表单操作和发布,我尝试使用一段 javascript,但我一直遇到同样的问题,为什么不发布?
我也尝试过在 php 页面上使用$_GET
而不是$_POST
无济于事。