我有线问题。
我在表单中有这个输入
<form action="..." method="post">
<div class="radio">
<input class="check-with-label" type="checkbox" id="c1-img0" name="img;http://img01.cp.aliimg.com/bao/uploaded/i1/1610868057/T25iVOXaNeXXXXXXXX_!!1610868057.jpg">
<label class="label-for-check" for="c1-img0"><img src="http://img01.cp.aliimg.com/bao/uploaded/i1/1610868057/T25iVOXaNeXXXXXXXX_!!1610868057.jpg"></label>
</div>
</form>
但是在我的php文件中,当我调用print_r($_POST);
[img;http://img01_cp_aliimg_com/bao/uploaded/i1/1610868057/T25iVOXaNeXXXXXXXX_!!1610868057_jpg] => on
就像你看到我在PHP文件中的链接中丢失了所有点。
Orginal: img;http://img01.cp.aliimg.com/bao/uploaded/i1/1610868057/T25iVOXaNeXXXXXXXX_!!1610868057.jpg
Recived: img;http://img01_cp_aliimg_com/bao/uploaded/i1/1610868057/T25iVOXaNeXXXXXXXX_!!1610868057_jpg
答案 0 :(得分:2)
您已将图片链接放在name
属性中,而不是value
。
尝试
<form action="" method="post">
<div class="radio">
<input class="check-with-label" type="checkbox" id="c1-img0" name="image" value="img;http://img01.cp.aliimg.com/bao/uploaded/i1/1610868057/T25iVOXaNeXXXXXXXX_!!1610868057.jpg">
<label class="label-for-check" for="c1-img0"><img src="http://img01.cp.aliimg.com/bao/uploaded/i1/1610868057/T25iVOXaNeXXXXXXXX_!!1610868057.jpg"></label>
</div>
<input type="submit" value="submit">
</form>
<?php
var_dump($_POST);
?>