如果出现以下情况,我如何使用 PHP 自动更改页面

And*_*irn 4 php mysql database url hyperlink

... if 语句的条件是否满足?

如果满足某些条件,我有一些代码可以将数据添加到数据库,添加数据后我希望页面重定向到另一个页面?我怎样才能做到这一点?

Dhr*_*sha 5

使用 if-else 条件。您可以使用 PHP 的 header() 。

if(/* Your conditions */){
// redirect if fulfilled
header("Location:nxtpage.php");
}else{
//some another operation you want
}
Run Code Online (Sandbox Code Playgroud)