完成以下编码后,我必须自动重新加载到我家
if($sql)
{
echo "Updated successfully";
}else {
echo "Con not update" . mysql_error();
}
这是process.php页面,我在执行查询后正在编写一些代码,我需要重定向到我的home.php页面,并显示弹出消息if$sql updated successfully message(successfull)if not error message。
此外,在纯PHP中,无需编写一段JavaScript代码,就可以做到这一点:
Header('Location: home.php');
这段代码在PHP上功能强大,它会将您重定向到请求的页面。
您需要使用JavaScript进行警报和重定向。
if($sql) {
echo "<script>alert('Updated successfully');
window.location.href='home.php';
</script>";
}
else {
echo "Con not update" . mysql_error();
}