Re: how to get value from checkbox's variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

you need to store as an array
change name="hoby" to name="hoby[]"

then in php you can reffer it as any array

eg:-
print_r($_POST['names']);

Regards,
Remy

On Nov 20, 2007 11:48 PM, Angga Sanjaya <fux_2005@xxxxxxxxx> wrote:
>
>
>
>
>
>
> hi All...before sory for my bad english
>  i have a HTML code with checkbox input,this is my full code :
>  <form action="view.php" method="POST">
>  <input type="checkbox" name="hoby" value="Sleeping">Sleeping<br>
>  <input type="checkbox" name="hoby" value="Eating">Eating<br>
>  <input type="checkbox" name="hoby" value="Working">Working<br>
>  <input type="checkbox" name="hoby" value="Walking">Walking<br>
>  <input type="submit" name="submit" value="Send">
>  how i get the value from that checkbox with format item1,item2,item3,item4
> with PHP code,example :
>  user select All hobies in that form so the output is "My hobies is
> Sleeping,Eating,Working,Walking" or if user only select sleeping and
> walking, the output is "My hobies is Sleeping,Walking".
>  My friends suggest me to use implode function but i don't know how to use
> that.
>  thanx before for your respon and answer.
>
>  ^quick-sniffer^
>
>
>  __________________________________________________________
>  Get easy, one-click access to your favorites.
>  Make Yahoo! your homepage.
>  http://www.yahoo.com/r/hs
>
>  [Non-text portions of this message have been removed]
>
>  



-- 
"Many people will walk in and out of your life,
but only true friends will leave footprints in your heart.
To handle yourself, use your head;
To handle others, use your heart."

"A bend in the road is not the end of the road unless you fail to make the turn"

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux