您好我想在提交之前在返回确认按钮中显示为用户选择的文件的名称。到目前为止,这是我的代码。如何通过返回确认按钮调用php函数?任何建议都将是理解
<form method ="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<?php
echo "<ul>";
foreach($dir as $item){
$items = basename($item);
$str = str_replace("+"," ",$items);
if(strpos($str,'test') === false){
if(strlen($str)==3){
$strs = ucwords(strtoupper($str));
echo "<li><input type = 'checkbox' class='check-class' name='chk[]' id=$strs value=$item >$strs<br>";
}
#echo ucwords(strtoupper($str));
else{
$strs = ucwords($str);
echo "<li><input type='checkbox' class='check-class' name='chk[]' id=$strs value=$item>$strs<br>";
}
#echo ucwords($str);
echo "</li>";
}
}
echo "</ul>";
?>
<div style="text-align:center"><button name="Deploy" type="submit" style="font-face:'Comic Sams MS';font-size:larger;color:red;background-color:#FAF0E6;border:3pt ridge lightgrey" onclick="return confirm('Are you sure you want to exclude these folders?.Folders Selected:')" value="submit">Initiate Deployment</button> </div> </div> </form>