I have the following code that receives one of the four alternative checkbox answers in a dispute.
Instead of reading the Correpsonding value, my database posts it forever, every time a box is checked for - My codes are - PHP: HTML: Try it out: 0 I'm guessing that this key Is it possible to show value here? I tried to replace the place with the value but there was no success.
foreign currency ($ _ POST ['person'] $ Key = & gt; $ person) {$ _POST ['person'] [$ key] = interval ($ person); } $ Person = implode (',', $ _POST ['person']);
& lt; Ul class = "ratings" & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" name = "person [1]" value = "excellent" /> < / Li & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" name = "person [2]" value = "good" /> & lt; / Li & gt; & Lt; Li & gt; Input type = "checkbox" name = "person [3]" value = "satisfactory" /> gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" name = "person [4]" value = "poor" /> & lt; / Li & gt; & Lt; / Ul & gt;
$ person = implode (',', Array_keys ($ _ POST ['person']));
_POST ['person'] In the array, the keys are
1, 2, 3, 4 , values are
excellent, good, satisfying, poor . In your code, you were calling
intval () on prices, which gives
0 for any number.
No comments:
Post a Comment