To just redirect the page in PHP use:
Now let’s say that after you process a form update, you want to let the user know that the update occurred successfully. The following works for that purpose. I’m going to post it with the functions I use in a Utility class for my own future reference.
First, the functions as used in some PHP file.
echo Utility::alert("Data successfully updated."); echo Utility::redirect(HOME_PAGE."?userId=".Utility::get("userId"));
Next, the class with the two functions used in the example.
At a later time, I’ll put up my Utility::post($field), Utility::get($field), and Utility::session($field) functions.