Jump to content

ramunas

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by ramunas

  1. ramunas

    Radio input

    <?php/*Program: CarCatalog.php *Desc: Displays a list of car categories from the cartype table. Includes descriptions. * Displays radio buttons for user to check. */?><html><head><title>Car Types</title></head><body><?php include("misc.inc");$cxn = mysqli_connect($host,$user,$passwd,$dbname)or die ("couldn't connect to server");$query = "SELECT * FROM cartype ORDER by carType";$result = mysqli_query($cxn,$query)or die ("Couldn't execute query.");/* Display text before form */echo "<div style='margin-left: .1in'>\n<h1 style='text-align: center'>Car Catalog</h1>\n<h2 style='text-align: center'> The following vehicles are waiting for you.</h2>\n<p style='text-align: center'>Find just what you want and hurry in to the store to pickup your best car.</p><h3>Which car are you interested in?</h3>\n";/* Create form containing selection list */echo"<form action='Showcars.php' method='POST'>\n";echo"<table cellpadding='5' border='1'>";$counter=1;while($row = mysqli_fetch_assoc($result)){extract($row);echo "<tr><td valign='top' width='15%' style='font-weight: bold; font-size: 1.2em'\n"; echo "<input type='radio' name='interest'value='$carType'\n"; if( $counter == 1 ){echo "checked='checked'";}echo ">$carType</td>";echo "<td>$modalDescription</td></tr>";$counter++;}echo "</table>";echo "<p><input type='submit' value='Select Car Type'></form></p>\n"; ?></div></body></html>
×
×
  • Create New...