how to stop refreshing page in php [duplicate]
if(isset($_POST["subSubmit"])){
if($_POST["subSubmit"]=="Send") {
$sentto = $_POST['txtSentto'];
$sentcc = $_POST['txtcc'];
$sel="insert into newmessage set sendto='".$sentto."',
sentcc='".$sentcc."'";
$开发者_如何学编程selqur=mysql_query($sel) or die("Error (" . mysql_errno() .")" . mysql_error());
}
}
i am php beginner i dont know how to stop the reload page.For the above program not reload without submit button once submit button clicked data stored in database and then click refreshing the page the data automatically send to database.Plz give any ideas thank you
You want the POST / Redirect / GET pattern.
Also, sanitize your outside variables ($_POST
) being used in your SQL.
精彩评论