php修改找不到数据类型,php – 在$_POST中找不到输入类型=图像值
只需使用
var_dump()來查看$_POST中的內容:
var_dump($_POST);
您會看到,當您使用< input type =“image”>提交表單時,您會得到:
array
'buyuka_x' => string '0' (length=1)
'buyuka_y' => string '0' (length=1)
所以,沒有$_POST [‘buyuka’] – 相反,有:
> $_POST [‘buyuka_x’]
>和$_POST [‘buyuka_y’]
這意味著你的代碼應該是這樣的(不測試不存在的buyuka條目,并測試兩個_x和_y – 我想測試其中一個就足夠了):
if(isset($_POST['buyuka_x'], $_POST['buyuka_y']))
{
$sorgu='SELECT * FROM urunler ORDER BY uyeno DESC';
}
評論后編輯:我不知道為什么會這樣 – 但是.x和.y是HTML標準中的定義.
如果您看一下Forms in HTML documents,向下滾動一下,您將能夠閱讀:
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中,參數名稱中的點自動替換為unerscore.
所以:
> name.x成為name_x
>和name.y成為name_y
作為最后一個語句的來源,您可以閱讀變量From External Sources – HTML Forms (GET and POST)(引用):
Dots and spaces in variable names are
converted to underscores.
For
example becomes
$_REQUEST["a_b"].
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的php修改找不到数据类型,php – 在$_POST中找不到输入类型=图像值的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: matlab的三维伪彩图,matlab画
- 下一篇: 简述div标签和span标签的不同_di