<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?
$connectdb = mysql_connect("database url","brugernavn","password");
// hvis forbindelse til databasen mysqlykkedes
if (!$connectdb)
{
die ("Fejl i forespørgsel: $connectdb. " . mysql_error());
};
mysql_select_db(databasens navn);
else if ($skema == "")
{
?>
<body>
<form name="form1" method="post" action="<?$_server['PHP_SELF']?>">
<input type="radio" name="spg1" value="yes">
<input type="radio" name="spg1" value="no">
<p>
<input type="radio" name="spg2" value="yes">
<input type="radio" name="spg2" value="no">
</p>
<p>
<input type="radio" name="spg3" value="yes">
<input type="radio" name="spg3" value="no">
</p>
<p>
<input type="radio" name="spg4" value="yes">
<input type="radio" name="spg4" value="no">
</p>
<p>
<input type="radio" name="spg5" value="yes">
<input type="radio" name="spg5" value="no">
</p>
<p>
<input type="radio" name="spg6" value="yes">
<input type="radio" name="spg6" value="no">
</p>
<p>
<input type="radio" name="spg7" value="yes">
<input type="radio" name="spg7" value="no">
</p>
<p>
<input type="radio" name="spg8" value="yes">
<input type="radio" name="spg8" value="no">
</p>
<p>
<input type="radio" name="spg9" value="yes">
<input type="radio" name="spg9" value="no">
</p>
<p>
<input type="radio" name="spg10" value="yes">
<input type="radio" name="spg10" value="no">
</p>
<p>
<input type="text" name="navn">
</p>
<p>
<input type="text" name="email">
</p>
<p>
<input type="submit" name="submit" value="Send svar">
<input type="hidden" name="skema" value="udfyldt">
</p>
</form>
<?
}
else if ($skema == "udfyldt")
{
$query_pers = "INSERT INTO databasetabellens navn (spg1, spg2, spg3, spg4, spg5, spg6, spg7, spg8, spg9, spg10, navn, email) VALUES ('".$spg1."', '".$spg2."', '".$spg3."', '".$spg4."', '".$spg5."', '".$spg6."', '".$spg7."', '".$spg8."', '".$spg9."', '".$spg10."', '".$navn."', '".$email."')";
$result_pers = mysql_query($query_pers);'
echo "dine svar er blevet registret";
}
?>
</body>
</html>
Det her er et utestet php script jeg lige har skrevet, det kan du jo kigge lidt på....
Hvis du har mySQL har du så ikke også nærmest per definition adgang til PHP....tilgiv min uvidenhed, men er også relativ ny i database sammenhæng
Kristian