Home > Backend Development > PHP Tutorial > type='image'的值如何post到php

type='image'的值如何post到php

WBOY
Release: 2016-06-13 10:29:23
Original
885 people have browsed it

type='image'的值怎么post到php?
type='image'的值怎么post到php?

最近在做zencart网店系统安装一个收藏夹插件遇到一个奇怪的事情
form底下有2个按钮,
一个是收藏夹按钮


一个是购物车按钮


按常理来说,2个按钮都是提交form使用的,但实际上按2个按钮却实现不一样的功能,确定了没有js影响。

我做了个简单的实验,看是否能提交图片按钮的值,貌似不行,求大师解答,怎么post image的值?



PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php @$text=$_POST['text'];    @$d=$_POST['d'];    if($text){echo $text;}    if($d){echo $d;}?>
Copy after login


------解决方案--------------------
echo $_POST['d'];


是作为提交按钮使用的
所以当点击 时 hello world 不会被提交

你把php部分写成 print_r($_POST); 就都清楚了
------解决方案--------------------
name="wishlist"
购物车 的可能是贴漏了

总之,不同的 name 做不同的事情


------解决方案--------------------
上传图片用:
HTML code
<input type="file" name="upImg" value="" title="上传图片"><div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template