TaG
TaG

Reputation: 63

How to grab a hidden fields value using PHP

I was wondering how can I grab the value from a hidden field using PHP?.

Here is the hidden field.

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

Upvotes: 6

Views: 44636

Answers (4)

nik
nik

Reputation: 3678

Like this: $_REQUEST['delete']

Upvotes: 1

cosy
cosy

Reputation: 572

if you use post method use $_POST['delete']; if you use get method use $_GET['delete']; Or for both method use $_REQUEST['delete'];

Upvotes: 0

o0&#39;.
o0&#39;.

Reputation: 11863

exactly like a non-hidden value.

$_POST["delete"]

Upvotes: 22

Rob
Rob

Reputation: 6871

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

$_POST["delete"]

Upvotes: 4

Related Questions