chowdary wrote:
Quote:
I am developing a PHP-mysql database. It is noted that when the
browser window is refreshed the data is inserted again in the
database. unfortunately there is no unique keys that I can use to
verify the existance of the data, so as to prevent the multiple
insertion.
So you have a problem.
And since you cannot avoid a refresh of the screen...
If you are doing a form post, you might consider sending a location
header AFTER you inserted the record:
<form action="process.php" method="POST">
<input type="text" name="number">
<input type="sumbit">
</form>
then from process.php:
// do you usual inserts in the database based on the post
header("Location: http://www.example.com/thanks.php");
// do not forget the exit, since your script will run on without it.
exit;
In that way your script will process the posting, and then redirects the
browser to thanks.php.
A reload of thanks.php will not result in a fresh db insert.
Hop ethat helps.
Regards,
Erwin Moller