<
| !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | |
| <html> | |
| <head> | |
| <meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT"> | |
| <meta http-equiv="Pragma" content="no-cache"> | |
| <meta http-equiv="Cache-Control" content="no-cache"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <meta http-equiv="Lang" content="en"> | |
| <meta name="author" content=""> | |
| <meta http-equiv="Reply-to" content="@.com"> | |
| <meta name="generator" content="PhpED 5.8"> | |
| <meta name="description" content=""> | |
| <meta name="keywords" content=""> | |
| <meta name="creation-date" content="01/01/2009"> | |
| <meta name="revisit-after" content="15 days"> | |
| <title>Untitled</title> | |
| <link rel="stylesheet" type="text/css" href="my.css"> | |
| </head> | |
| <body> | |
| <form action="listbox2.php" method="post"> | |
| <select name="cars"> | |
| <option value="volvo">Volvo</option> | |
| <option value="saab">Saab</option> | |
| <option value="fiat">Fiat</option> | |
| <option value="audi">Audi</option> | |
| </select> | |
| <input type="submit" value="Submit Pick" /> | |
| </form> | |
| </body> | |
| </html> |
<?php
$con = mysql_connect("localhost","root","Spider1");
if(!$con)
{
die('Could not connect' . mysql_error());
} mysql_select_db('cric',$con);
//$_POST['formDoor'] = "HELLO";
// $aDoor = $_POST['formDoor'];
$internet = "internet";
$google = "google";
$paper = "paper";
$friends = "friends";
$Car = $_POST['cars'];
$query="INSERT INTO spidy (FirstName)VALUE ('".$Car."')";
mysql_query($query) or die ('Error submitting');
echo "You Chose: " .$Car ;
/* $xyz1 = "INSERT INTO spidy(PersonID, FirstName) VALUES ('$_POST[id]','$internet')";
$xyz2 = "INSERT INTO spidy(PersonID, FirstName) VALUES ('$_POST[id]','$google')";
$xyz3 = "INSERT INTO spidy(PersonID, FirstName) VALUES ('$_POST[id]','$paper')";
$xyz4 = "INSERT INTO spidy(PersonID, FirstName) VALUES ('$_POST[id]','$friends')";
if(('$_POST[internet]')== '1' )
{
echo "Checked is On";
}
else
echo "no checked";
if('$_POST[internet]')
{
mysql_query($xyz1);
}
elseif('$_POST[google]')
{
mysql_query($xyz2);
}
elseif('$_POST[paper]')
{
mysql_query($xyz3);
}
elseif('$_POST[friends]')
{
mysql_query($xyz4);
}
elseif(('$_POST[internet]') && ('$_POST[google]') && ('$_POST[paper]')&& ('$_POST[friends]'))
{
mysql_query($xyz1);
mysql_query($xyz2);
mysql_query($xyz3);
mysql_query($xyz4);
}
else
echo "check karo";
switch($next):
case ($_POST['google']) :
mysql_query($xyz2);
break;
case ($_POST['paper']) :
mysql_query($xyz3);
break;
case ($_POST['friends']) :
mysql_query($xyz4);
break;
case ($_POST['internet']) :
mysql_query($xyz1);
break;
default:
echo "Select any one chekbox";
endswitch;
if('$_POST[formDoor]')
{
mysql_query($xyz);
}
else
echo "wrong";
*/
?>
>