hi there! This is actually my first post over here.. I thought i'd register since most answers to my common problems that i google up turn up to be in this site.. however I have a problem myself now.
This is the source code: (PHP)
[php]if(mysql_error( )) { // was there an error ?
//yes, issue warning
echo "Sorry, your comment was <b>not</b> added due to a database error!";
}
else { // no, print success and link
echo "<meta http-equiv='refresh' content='0'>";
}[/php]
what am i trying to do over here? basically i'm working on a site where visitors can post comments. Now since i'm using POST data, we all know that if a user refreshes the page it gets reposted. I know that your browser gives you an error, but let's face it -- the common user doesn't even know what POST data is, moreover what the error generated by the browser means.
now onto my problem. the code runs the mysql query with tha data that has been submitted in the comment form (after being validated) As shown in the source code, if there was a mysql error, it will display an error to the user. else it is supposed to refresh by echo'ing a meta tag. Just a couple of weeks ago, just after coding this thing, it worked flawlessly. But now it doesn't! I checked that it is actually refreshing by setting the number of seconds to 5 and checked that it is being refreshed.. but still the POST data is still there, because when I hit the refresh button, it displays the POST data error.
If you have any idea why this is happening please let me know.. cos it's driving me nuts, especially when I know that a couple of weeks ago it worked flawlessly :/
thanks guys,
ninuhadida.
This is the source code: (PHP)
[php]if(mysql_error( )) { // was there an error ?
//yes, issue warning
echo "Sorry, your comment was <b>not</b> added due to a database error!";
}
else { // no, print success and link
echo "<meta http-equiv='refresh' content='0'>";
}[/php]
what am i trying to do over here? basically i'm working on a site where visitors can post comments. Now since i'm using POST data, we all know that if a user refreshes the page it gets reposted. I know that your browser gives you an error, but let's face it -- the common user doesn't even know what POST data is, moreover what the error generated by the browser means.
now onto my problem. the code runs the mysql query with tha data that has been submitted in the comment form (after being validated) As shown in the source code, if there was a mysql error, it will display an error to the user. else it is supposed to refresh by echo'ing a meta tag. Just a couple of weeks ago, just after coding this thing, it worked flawlessly. But now it doesn't! I checked that it is actually refreshing by setting the number of seconds to 5 and checked that it is being refreshed.. but still the POST data is still there, because when I hit the refresh button, it displays the POST data error.
If you have any idea why this is happening please let me know.. cos it's driving me nuts, especially when I know that a couple of weeks ago it worked flawlessly :/
thanks guys,
ninuhadida.
Comment