0

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 ) 
4
  • have you got <?PHP ?> tags to wrap the code? Commented Jul 24, 2014 at 10:33
  • yes @mithunsatheesh ............... Commented Jul 24, 2014 at 10:34
  • Is the form submitted with post? Commented Jul 24, 2014 at 10:34
  • yes @mudasobwa -> <form method='post'.... Commented Jul 24, 2014 at 10:36

1 Answer 1

2

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

<input type='checkbox' class='tinyField' name="informTktUpdate[hd]" value="1" />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.