• 0
Sign in to follow this  
SirSmart

Checkbox

Question

2 answers to this question

Recommended Posts

  • 0

html

<form method = "post" action="oi.php">

0 - <input type="checkbox" value="0" name="chknome[]"><br>

1 - <input type="checkbox" value="1" name="chknome[]"><br>

2 - <input type="checkbox" value="2" name="chknome[]"><br>

3 - <input type="checkbox" value="3" name="chknome[]"><br>

4 - <input type="checkbox" value="4" name="chknome[]"><br>

5 - <input type="checkbox" value="5" name="chknome[]"><br>

6 - <input type="checkbox" value="6" name="chknome[]"><br>

7 - <input type="checkbox" value="7" name="chknome[]"><br>

<input type="submit" value="ok" />

</form>

Php

<?php

$aArray = $_POST[ "chknome" ];

for( $i=0; $i < count( $aArray ); $i++ )

{

echo $sSql = " Os valores escolhidos foram = ".$aArray[ $i ]."<br>";

}

?>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this