Checkboxes?

From: Date: Mon, 05 Jan 2004 22:43:01 +0000
Subject: Checkboxes?
Groups: php.general 
Request: Send a blank email to php-general+get-173788@lists.php.net to get a copy of this message
I am having a problem with checkboxes... <?php $_SESSION['logs'] .= "<tr><td width=\"25%\"><b>Date</b></td><td width=\"15%\"><b>Time</b></td><td width=\"20%\"><b>IP Address</b></td><td width=\"15%\"><b>Port</b></td><td width=\"20%\"><b>Log Message</b></td><td width=\"20%\" align=\"right\"><b>Details?</b></td></tr>"; require 'database_script.php'; $table = "logs"; $sql = mysql_query("SELECT * FROM $table ORDER BY date",$db)or die(mysql_error()); while($row = mysql_fetch_array($sql)) { list($id,$date,$time,$ip,$host,$referer,$agent,$page,$pagecount,$message,$session) = $row; $_SESSION['logs'] .= "<tr><td>$date</td><td>$time</td><td>$ip</td><td>$host</td><td>$message</td><td align=\"right\"><input name=\"id\" type=\"checkbox\" value=\"$id\"></td></tr>"; } // Begin checking if variables are present... if (empty($_POST['id'])) { unset($_SESSION['details']); $_SESSION['details'] = "<img src=\"images/error.jpg\">&nbsp;&nbsp;<b>You must select an access log(s) to view the details of</b>"; } elseif (!empty($_POST['id'])) { unset($_POST['details']); $_SESSION['details'] = "You have selected record number..."; } else { unset($_SESSION['details']); $_SESSION['details'] = "<img src=\"images/error.jpg\">&nbsp;&nbsp;<b>You must select an access log(s) to view the details of.</b>"; } ?> I think it has something to do with the naming or values of the checkboxes but if someone could shed some light on it that would be great. jas

« previous php.general (#173788) next »