Ok I know this sounds weird, but I want a file to delete itself, and then redirect somewhere - This obviously wouldn't work as the file would be deleted so wouldn't be able to read the next line of code.
Basically I have an "install" file, which while there, redirects all other files to it for setup purposes and then once the user has configured it I want it to delete itself so other files don't redirect to it anymore.
How could this be done?
Please just ask if you want me to explain a bit more.
I have actually made code that works below:
PHP Code:
if (mysql_query($query))
{
$link = "index.php";
redirect_to($link);
unlink("install.php"); // install.php is the file being run
}
Will this always work or is it bad practice?
Bookmarks