Its a very silly problem but somehow it is not working
I have a function to create a file, if it goes through with it i want it to redirect the user to X page.. in this case 1.php…. but somehow is not working :S why?
//Creates File, populates it and redirects the user.
if (createfile($dbFile)) {
header('Location: 1.php');
}
You need to
exit()after sending a redirect header:Otherwise, PHP continues to execute. If you
exit(), the client receives the header right after you make the call toheader().You should also heed this warning on the PHP docs page for
header():