0

Hello guys, i got a small problem here.

I can write and press "send" to submit a private message to a memeber, right... but if i refresh the page, the message gets sent again..

Anyone know a small php script i could put on top of the page to avoid script re-run?

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by vibhaJ
0

Don't send the form to itself (same page). Send it to a form handler file and then redirect back to the form page. Refresh will no longer reload said form.

0

Because you haven't provided header after your logic.
Lets your page name is 'page.php'.

<?
	if(condition)
	{
		// your 
		// message
		// sending
		// code
		header("location:page.php");
		exit;
	}
?>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.