I have a form with select , text and checkboxes. I want only selected check boxes to be processed by the form handler- at the moment when submitted all checkboxes are displayed, selected being marked "yes". The form handler also adds values to mysql database.(I have edited code for this post) All works fine, except I cannot work how to not display checkboxes that are not selected in form handler. The form handler also works out a cost of all selected items
Form Code is :
<?php # Script 12.5 - index.php
// This is the main page for the site.
// Include the configuration file for error management and such.
require_once ('config.inc');
<tr>
<td width="35%">Norton Anti-Virus £35
<input type="checkbox" name="nav" value="1"></td>
<td width="31%">Microsoft Office-Student £105
<input type="checkbox" name="mso" value="1"></td>
<td width="34%">Dragon Naturally Speaking £138
<input type="checkbox" name="dns" value="1"></td>
</tr>
<p>
<input type="hidden" name="submitted" value="yes" />
<input type="submit" value="submit" />
</p>
FORM HANDLER
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" media="screen">@import url(includes/layout.css);</style>
</head>
<body>
<?php
// Set the page title and include the HTML header.
$page_title = 'Computers for DSA';
include_once ('header.html');
require_once ('mysql_connect.php');
?>
<?php
// Welcome the user (by name if they are logged in).
echo '<h1>Dear';
if (isset($SESSION['first_name'])) {
echo ", {$SESSION['first_name']}!";
}
echo '</h1>';
?>
<p align="center">Computer Store Quotation Form</p>
<p>You have selected the following items. Please check, and if confirmed click
Order Button . To Print this order
click print. To alter click back</p>
<p>Student Name and College: <font color="#0000A0" coloor="#0000A0"> <strong>
<p>Originator: <font color="#0000A0" coloor="#0000A0"> <strong>
<?php
if ($origin) echo "$origin";?>
<p>Student Name and College: <font color="#0000A0" coloor="#0000A0"> <strong>
<?php
if ($studname) echo "$studname";?>
</strong> </font></p>
<p>System: <font color="#0000A0"> <strong>
<?php
if($systems == None) echo " none";//if new product added start by adding name as opposite with if options
if($systems == 2) echo " Intel Celeron,256Mb Ram, 40Gb HDD,Int Modem,CDRW, Windows Home";
if($systems == 3) echo " P4 3.06Ghz, 256Mb Ram, 80Gb HDD,Int Modem, Windows Home";
?>
</strong></font></p>
<P>Ram Upgrade to 512mb :<font color="#0000A0"> <strong>
<?php
if($ramup ==1) echo "yes";
?>
</strong></font></P>
<P>CD-RW Upgrade to DVD-RW :<font color="#0000A0"> <strong>
<?php
if($dvd ==1) echo "yes";
</strong></font></P>
<p>Monitor: <font color="#0000A0"> <strong>
<?php
if($monitor == None) echo " none";
if($monitor == 2) echo " TFT 15";
if($monitor == 3) echo " TFT 17";
if($monitor == 4) echo " TFT 19";
?>
</strong></font></p>
<p>Printer :<font color="#0000A0"> <strong>
<?php
if($printer == None) echo " none";
if($printer == 2) echo " Epson C66";
if($printer == 3) echo " Epson C86";
if($printer == 4) echo " HP 3845";
?>
</strong></font></p>
<p>Scanner :<font color="#0000A0"> <strong>
<?php
if($scanner == None) echo " none";
if($scanner == 2) echo " Canonlide 35";
if($scanner == 3) echo " Epson Perfection 2480";
?>
</strong></font></P>
<P>3 Year Extended Warranty :<font color="#0000A0"> <strong>
<?php
if($exw ==1) echo "yes";
?>
</strong></font></P>
<P>Norton Anti-Virus :<font color="#0000A0"> <strong>
<?php
if($nav ==1) echo "yes";
?>
</strong></font></P>
<P>Microsft Office Student Version :<font color="#0000A0"> <strong>
<?php
if($mso ==1) echo "yes";
?>
</strong></font></P>
<P>Dragon Naturally Speaking Preferred v7 :<font color="#0000A0"> <strong>
<?php
if($dns ==1) echo "yes";
?>
</strong></font></P>
<P>Omni Page Pro :<font color="#0000A0"> <strong>
<?php
if($opp==1) echo "yes";
?>
</strong></font></P>
<P>AutoCad Student :<font color="#0000A0"> <strong>
<?php
if($atc ==1) echo "yes";
?>
</strong></font></P>
<P>Revit Series 2 Student Edition :<font color="#0000A0"> <strong>
<?php
if($rev ==1) echo "yes";
?>
</strong></font></P>
<P>Text Help Read :<font color="#0000A0"> <strong>
<?php
if($thr ==1) echo "yes";
?>
</strong></font></P>
<P>Inspiration V7.5 :<font color="#0000A0"> <strong>
<?php
if($insp ==1) echo "yes";
?>
</strong></font></P>
<P>Franklin Spell Checker DMQ :<font color="#0000A0"> <strong>
<?php
if($fsc ==1) echo "yes";
?>
</strong></font></P>
<P>External Mouse :<font color="#0000A0"> <strong>
<?php
if($exmo ==1) echo "yes";
?>
</strong></font></P>
<P>Mouse Support : <font color="#0000A0"> <strong>
<?php
if($mosup ==1) echo "yes";
?>
</strong></font></P>
<P>USB Soundcard :<font color="#0000A0"> <strong>
<?php
if($usbsc ==1) echo "yes";
?>
</strong></font></P>
<P>Digital Dictaphone :<font color="#0000A0"> <strong>
<?php
if($digdic ==1) echo "yes";
?>
</strong></font></P>
<P>External Microphone for Digital Dictaphone :<font color="#0000A0"> <strong>
<?php
if($exmic ==1) echo "yes";
?>
Any help appreciated, I have tried a couple of options, but just get errors.
<?php