Hi i have got multiple check box working in test file but when i try and put it and check box all i get is array i put this bit in profile.php
$length = count($interests);
for ($i = 0; $i < $length; $i++){
echo $interests[$i];
echo ' ';
}
?>
in the html bit but wrapped php round it
and this bit in php block on edit profile and i get the following
$interests = $_POST['interests'];
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/jktempla/public_html/cedit_profile.php on line 57
and if i keep the existing
interests = '".$_POST['interests']."' ,
i get the following : ARRAY where the selections are to show
can anyone tell me where to put all any help would be much appriecated x
this is the complete check box code
<?php
$interests = $_POST['interests'];
$length = count($interests);
for ($i = 0; $i < $length; $i++){
echo $interests[$i];
echo ' ';
}
?> <!DOCTYPE HTML> <html> <head> <meta http-equiv="content-type" content="text/html" /> <meta name="author" content="Kevin Robinson" /> <title>Untitled 2</title> </head> <body> <form method="post"> <table width="900"> <tbody> <tr> <td width="900"><input name="interests[]" id="option1" value="option1" type="checkbox"><p style="font-size:+1;">option1</p></td> <td width="900"><input name="interests[]" id="option2" value="option2" type="checkbox">option2</td> <td width="900"><input name="interests[]" id="option3" value="option3" type="checkbox">option3</td> </tr> </tbody> </table> <input type="submit" value="Show my Items" name="save"/> </body> </html>