PHP: 用readonly取代disabled来获取input值 submit a disabled input in a form could not ge

阅读更多

The form is like below;

 

$info = "type1"; and the $info works fine in the form.

but In the sendmail.php

$name=$_GET['name'];
$type=$_GET['textinput-disabled'];
$phone=$_GET['phone'];

 

最好的解决方法是将disabled更换成hidden或者readonly

Disabled fields are not submitted. You can make it readonly or hidden, to get value when submitted.

 

share: http://stackoverflow.com/a/25264539/4484798

 

更多参考:

php实现畅言留言板和网易跟帖样式

兼容IE和FF:获取Referer的JS和PHP方法 及 PHP利用curl伪造IP和来路

PHP5: mysqli 插入, 查询, 更新和删除 Insert Update Delete Using mysqli (CRUD)

 

本文转自: PHP: 用readonly取代disabled来获取input值 submit a disabled input in a form could not get value

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(PHP: 用readonly取代disabled来获取input值 submit a disabled input in a form could not ge)