简体   繁体   English

如何使用PHP获取隐藏字段值

[英]How to grab a hidden fields value using PHP

I was wondering how can I grab the value from a hidden field using PHP?. 我想知道如何使用PHP从隐藏字段中获取值?

Here is the hidden field. 这是隐藏的领域。

<input type="hidden" name="delete" value="' . $row['delete_id'] . '" />

完全像一个非隐藏的值。

$_POST["delete"]

I assume the hidden field is in a form. 我假设隐藏字段是一种形式。 So give it an id and do it like you normally would get the value from an input field 所以给它一个id,就像你通常会从输入字段中获取值一样

$_POST["delete"]

像这样: $_REQUEST['delete']

if you use post method use $_POST['delete']; 如果你使用post方法使用$ _POST ['delete']; if you use get method use $_GET['delete']; 如果使用get方法,请使用$ _GET ['delete']; Or for both method use $_REQUEST['delete']; 或者对于这两种方法都使用$ _REQUEST ['delete'];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM