How to prevent the page to process and insert data into database, when the page loaded to browser?
the code...
Code: Select all
<?
include "../conf.php";
$teks = $_POST['text'];
mysql_query("INSERT INTO article(text) VALUES ('$text')");
if(mysql_query){
echo "ok";
}else{
echo "bad";
}
?>
<html>
<body>
<form name="artikel" action="<? $PHP_SELF ?>" method="post">
<textarea name="teks" cols="100" rows="20"></textarea>
<input type="submit" name="submit">
</form>
</body>
</html>