<?php
if (isset($_POST['submit']) {
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
mysql_query("INSERT INTO balsai (nick, browser, comment)
VALUES ('".$_POST['nick']."', '".$_POST['browser']."', '".$_POST['comment']."')");
echo "Prideta";
}
mysql_close($con);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Žymė input</title>
</head>
<body>
<form name="test" method="post" action="">
<p><b>Jūsų vardas:</b><br>
<input name="nick" type="text" size="40">
</p>
<p><b>Kokia naršyklę dažniausiai naudojate:</b><Br>
<input type="radio" name="browser" value="ie"> Internet Explorer<Br>
<input type="radio" name="browser" value="opera"> Opera<Br>
<input type="radio" name="browser" value="firefox"> Firefox<Br>
</p>
<p>Komentaras<Br>
<textarea name="comment" cols="40" rows="3"></textarea></p>
<p><input name="submit" type="submit" value="Siųsti">
<input type="reset" value="Ištrinti"></p>
</form>
</body>
</html>