Hold The Process ?
Posted: Thu Mar 25, 2010 9:44 am
I have one page contain form and code for submission, when the page open it's automatically submit data, even the form empty.
How to prevent the page to process and insert data into database, when the page loaded to browser?
the code...
thanks
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>