Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use PHP to automatically change the page if [closed]

...the conditions of an if statement are fulfilled?

I have some code to add data to a database if certain conditions are met, after the data is added I want the page to redirect to another page? How can I do this?

like image 651
Andrew Fairbairn Avatar asked Dec 20 '22 23:12

Andrew Fairbairn


1 Answers

Use if-else condition. You can use header() of PHP .

if(/* Your conditions */){
// redirect if fulfilled
header("Location:nxtpage.php");
}else{
//some another operation you want
}
like image 67
Dhruvisha Avatar answered Mar 17 '23 14:03

Dhruvisha