i have a car inventory website, we all know cars can vary greatly. so i made a table with the most common attributes, it includes checkboxes, radios and text now i need to check each one, i dont know if an if statement for each one will be appropiate since there is three types of inputs i guess i can group them on the same for loop but i have no idea how to do this OR if is there a better way?
<h3>Add a vehicle</h3>
<form action="" method="post" enctype="multipart/form-data" >
<b>VIN: <input type="text" name="vin">
<button class="btn-success"><a style="color: white;" href="#">Decode Vin</a></button><br />
Year: <?php include 'admin/tool/caryears.php'; ?>
Make: <?php include 'admin/tool/carmakes.php'; ?>
Model: <input type="text" name="model"><br />
Mileage: <input type="text" name="mileage"><br />
Price: <input type="text" name="price"><br />
VIN: <input type="text" name="vin"><br />
Attribute: <input type="text" name="att1">
Attribute: <input type="text" name="att2"><br />
Attribute: <input type="text" name="att3">
Attribute: <input type="text" name="att4"><br />
<table border="1" bordercolor="FFCC00" style="background-color:FFFFCC" width="100%" cellpadding="3" cellspacing="3">
<center>
<b>Common Attributes</b>
<tr>
<th>Body style</th>
<td>SUV <input value="suv" name="bodystyle" type="radio"></td>
<td>Sedan <input value="sedan" name="bodystyle" type="radio"></td>
<td>Truck <input value="truck" name="bodystyle" type="radio"></td>
<td>Mini Van <input value="minivan" name="bodystyle" type="radio"></td>
<td>Convertible <input value="convertible" name="bodystyle" type="radio"></td>
<td>Coupe <input value="coupe" name="bodystyle" type="radio"></td>
</tr><tr><td></td>
<td>Hatchback <input value="hatchback" name="bodystyle" type="radio"></td>
<td>Hybrid <input value="hybrid" name="bodystyle" type="radio"></td>
<td>Diesel <input value="diesel" name="bodystyle" type="radio"></td>
<td>Crossover <input value="crossover" name="bodystyle" type="radio"></td>
</tr>
<tr>
<th>Engine and Performance</th>
<td>Engine Size <input name="enginesize" type="text" value=" L" class="input-small"></td>
<td>Cylinders <select name="cyl" class="input-small"><option>Select</option><?php $i=2; while($i<13){echo '<option value="cyl'.$i.'">'.$i.' Cylinders</option>'; $i++;}?></select></td>
<td>Horse Power <input name="hp" class="input-small" type="text"></td>
<td>Diesel <input value="diesel" name="fuel" type="radio"></td>
<td>Gasoline <input value="gasoline" name="fuel" type="radio"></td>
</tr>
<tr>
<tr>
<th>Transmission</th>
<td>Automatic <input value="automatic" name="transmission" type="radio"></td>
<td>Manual <input value="manual" name="transmission" type="radio"></td>
<td>4 Speed <input value="fourspeed" name="shifts" type="radio"></td>
<td>5 Speed <input value="fivespeed" name="shifts" type="radio"></td>
<td>6 Speed <input value="sixspeed" name="shifts" type="radio"></td>
<td>OverDrive <input name="od" type="checkbox"></td>
</tr>
<tr>
<th>Sound System</th>
<td>CD Player <input value="cd" name="sound" type="radio"></td>
<td>MP3 Player <input value="mp3" name="sound" type="radio"></td>
<td>DVD Player <input value="dvd" name="sound" type="radio"></td>
<td>GPS Nav <input name="gps" type="checkbox"></td>
<td>Brand: <input name="sound_system" type="text" class="input-small"></td>
<td>Satellite Radio <input name="sradio" type="checkbox"></td>
</tr>
<tr>
<th>Instrumentation</th>
<td>Tachometer <input name="tachometer" type="checkbox"></td>
<td>Clock <input name="clock" type="checkbox"></td>
<td>Trip Computer <input name="trip" type="checkbox"></td>
<td>Exterior-Weather <input name="eweather" type="checkbox"></td>
<td>All-Digital <input name="digitalboard" type="checkbox"></td>
</tr>
<tr>
<th>DriveTrain</th>
<td>Rear-wheel-drive <input value="rwd" name="drive" type="radio"></td>
<td>Front-wheel-drive <input value="fwd" name="drive" type="radio"></td>
<td>All-wheel-drive <input value="awd" name="drive" type="radio"></td>
<td>4x4 <input name="fxf" type="checkbox"></td>
<td>Cruise Control <input name="cruisecontrol" type="checkbox"></td>
<td>Tilt Steering <input name="tiltsteering" type="checkbox"></td>
</tr>
<tr>
<th>Inside and outside</th>
<td>A/C <input name="ac" type="checkbox"></td>
<td>Removable Top <input name="removabletop" type="checkbox"></td>
<td>Keyless <input name="keyless" type="checkbox"></td>
<td>AirBags <input name="airbags" type="checkbox"></td>
<td>Alloy Wheels <input name="alloy" type="checkbox"></td>
<td>Trunk anti-trap <input name="trunkantitrap" type="checkbox"></td>
</tr>
<tr>
<th>Electric Powered Options</th>
<td>Power Windows <input name="ewindows" type="checkbox"></td>
<td>Power Mirrors <input name="emirrors" type="checkbox"></td>
<td>Power Driver Seat <input name="eseat" type="checkbox"></td>
<td>Power Locks <input name="elocks" type="checkbox"></td>
<td>Vehicle Anti-theft <input name="antitheft" type="checkbox"></td>
<td>LED headlights <input name="ledheadlights" type="checkbox"></td>
</tr>
</table>
</form>
So i need to check each one, if its not empty or checked or selected then create an array.
i personally think im doing something wrong, is there a better way to go about this?
i basically need this info to enter it into a database of attributes