有没有办法通过点击此链接生成POST而不是GET参数:
<?
$dir="images/custom/";// putia do dir-a
$handle = opendir($dir);
if ($handle) {
while (($file=readdir($handle))!==false) {
echo '<center><a href="?cust='.$file.'"><img src="images/custom/'.$file.' "title="Click to set it" "></a></center><br />'; } }
?>
答案 0 :(得分:1)
将<a>
转换为表单提交:
<?php
$dir="images/custom/";// putia do dir-a
$handle = opendir($dir);
if ($handle) {
while (($file=readdir($handle))!==false) {
echo '<center><form method="post" action="?cust='.$file.'"><input id="test1" name="test1" type="image" src="images/custom/'.$file.'" title="Click to set it" /></form></center><br />';
}
}
?>
答案 1 :(得分:0)
这样做了:
echo'<form action="" method="post">
<a href="javascript:;" onclick="parentNode.submit();"><center><img src=images/custom/'.$file.' title="Click to set it" /></center></a>
<input type="hidden" name="mess" value='.$file.' />
</form>';
谢谢你的回答, 问候。