php修改找不到数据类型,php – 在$_POST中找不到输入类型=图像值
只需使用
var_dump()來(lái)查看$_POST中的內(nèi)容:
var_dump($_POST);
您會(huì)看到,當(dāng)您使用< input type =“image”>提交表單時(shí),您會(huì)得到:
array
'buyuka_x' => string '0' (length=1)
'buyuka_y' => string '0' (length=1)
所以,沒(méi)有$_POST [‘buyuka’] – 相反,有:
> $_POST [‘buyuka_x’]
>和$_POST [‘buyuka_y’]
這意味著你的代碼應(yīng)該是這樣的(不測(cè)試不存在的buyuka條目,并測(cè)試兩個(gè)_x和_y – 我想測(cè)試其中一個(gè)就足夠了):
if(isset($_POST['buyuka_x'], $_POST['buyuka_y']))
{
$sorgu='SELECT * FROM urunler ORDER BY uyeno DESC';
}
評(píng)論后編輯:我不知道為什么會(huì)這樣 – 但是.x和.y是HTML標(biāo)準(zhǔn)中的定義.
如果您看一下Forms in HTML documents,向下滾動(dòng)一下,您將能夠閱讀:
When a pointing device is used to
click on the image, the form is
submitted and the click coordinates
passed to the server.
The x value
is measured in pixels from the left of
the image, and the y value in pixels
from the top of the image.
The
submitted data includes
name.x=x-value and name.y=y-value
where “name” is the value of the name
attribute, and x-value and y-value are
the x and y coordinate values,
respectively.
在PHP中,參數(shù)名稱中的點(diǎn)自動(dòng)替換為unerscore.
所以:
> name.x成為name_x
>和name.y成為name_y
作為最后一個(gè)語(yǔ)句的來(lái)源,您可以閱讀變量From External Sources – HTML Forms (GET and POST)(引用):
Dots and spaces in variable names are
converted to underscores.
For
example becomes
$_REQUEST["a_b"].
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的php修改找不到数据类型,php – 在$_POST中找不到输入类型=图像值的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: matlab的三维伪彩图,matlab画
- 下一篇: 简述div标签和span标签的不同_di