<?php
if (@$_POST["submit"] = 'Siusti') {
$pavadinimas = @$_POST["pavadinimas"];
$turinys = @$_POST["turinys"];
@mysql_connect("localhost","username","password");
@mysql_select_db("database", $con);
$query = mysql_query("INSERT INTO news (title, new) VALUES ('$pavadinimas', '$turinys')");
if($query) echo "irasyta";
mysql_close();
} else {
?>
<center>
<form name="form1" method="post" action="<?php $SER ?>">
<strong>Pavadinimas:</strong><br>
<input name="pavadinimas" type="text" size="50"><br>Tekstas:<br>
<textarea name="turinys" cols="70" rows="10"></textarea><br>
<input type="submit" name="submit" value="Siusti">
</form>
</center>
<?php
}
?>