DEV Community

Discussion on: Sparks Foundation Banking Project - Converted to Full-Stack Mode With PHP and MySQL

Collapse
 
lito profile image
Lito

Remember to add an exit or die after every header('Location: XXX') because header do not stop script execution.

PHP header

You can add a simple helper to create redirects:

function redirect(string $url): void
{
    die(header('Location: '.$url));
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
souvik1406 profile image
Souvik Roy

Thanks man.... Just learning php and I'm really thankful for this precious advice๐Ÿ˜Š