RE: [PHP] arrays and php

From: Date: Tue, 30 Sep 2003 16:10:44 +0000
Subject: RE: [PHP] arrays and php
Groups: php.general 
Request: Send a blank email to php-general+get-164415@lists.php.net to get a copy of this message
Angelo Zanetti <mailto:binc2@ctech.ac.za> on Tuesday, September 30, 2003 5:43 AM said: > hi I have a table with rows and each row contains a checkbox ( array) > and a record. TD of the checkbox: > echo("<td width=15 bgcolor=#9FD9FF><input type=checkbox name=chkR[] > value=". $chkSessionF[$i] ."></td>"); Firstly you should be putting double quotes around every value in your HTML tags. Revised: (watch wrap) echo "<td width=\"15\" bgcolor=\"#9FD9FF\"><input type=\"checkbox\" name=\"chkR[]\" value=\"{$chkSessionF[$i]}\"></td>"; I also changed ". $chkSessionF[$i] ." into {$chkSessionF[$i]} . You can do it either way. I prefer the latter. If you're not sure what a value is use print_r() to determine it. echo "<pre>"; print_r($chk); echo "</pre>"; Quick side note on the above code: You cannot write it like: echo "<pre>".print_r($chk)."</pre>"; It will not work. > can anyone help. this is very strange. I think your problem may just be the quotes around the values in the HTML. Give it a shot. hth, chris.

« previous php.general (#164415) next »