roi
roi

Reputation: 47

send and print array values with post

Why my ECHO doesn't print the value 1 ?

<dl><input type='checkbox' class='tinyField' name="informTktUpdate['hd']" value="1" /> Inform user by email</dl>
<dl><input type='checkbox' class='tinyField' name="informTktUpdate['prog']" value="1"  /> Inform programmer by email</dl>

echo ($_POST['informTktUpdate']['prog']);

if I'm using "print_r(($_POST['informTktUpdate'])" i get:

 Array ( ['hd'] => 1 ['prog'] => 1 ) 

Upvotes: 0

Views: 48

Answers (1)

folibis
folibis

Reputation: 12854

remove the quotes around array keys in HTML parts. it have to be

<input type='checkbox' class='tinyField' name="informTktUpdate[hd]" value="1" />

Upvotes: 2

Related Questions