derrick1123 Posted March 16, 2008 Share Posted March 16, 2008 I have a file that I would like to be deleted after it is installed...is this possible? <?php include("db_settings.php"); $q = "CREATE TABLE remember ( id varchar(255) NOT NULL, name int(255) NOT NULL, msg int(255) NOT NULL, time int(255) NOT NULL, PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Message Reminder'; "; $go = mysql_query($q); if(!$go){ echo "SHIT!!! Redownload something went wrong."; } else { echo "YAY!!! The '<tt>rememberall<tt>' table has been installed in your database."; } ?> BTW, if any of this is not going to work, please let me know. Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/96371-how-to-delete-file-after-install/ Share on other sites More sharing options...
lordfrikk Posted March 16, 2008 Share Posted March 16, 2008 http://us.php.net/manual/en/function.unlink.php Quote Link to comment https://forums.phpfreaks.com/topic/96371-how-to-delete-file-after-install/#findComment-493264 Share on other sites More sharing options...
derrick1123 Posted March 16, 2008 Author Share Posted March 16, 2008 Does this only work with functions? ..Stupid question I know... I just wanted to add unlink($filename); at the end of the file if this is possible. Quote Link to comment https://forums.phpfreaks.com/topic/96371-how-to-delete-file-after-install/#findComment-493265 Share on other sites More sharing options...
wildteen88 Posted March 16, 2008 Share Posted March 16, 2008 The unlink function will delete files yes. However if you install your script on a *nix based server your script will need to have the neccesary (chmod) permissions in order to delete files. Quote Link to comment https://forums.phpfreaks.com/topic/96371-how-to-delete-file-after-install/#findComment-493326 Share on other sites More sharing options...
derrick1123 Posted March 16, 2008 Author Share Posted March 16, 2008 I forgot to chmod the folder. This is my first ever script I made, and am already half way done. I can't wait till this is finished. And thanks to phpfreak's for all your help. ^.^ Quote Link to comment https://forums.phpfreaks.com/topic/96371-how-to-delete-file-after-install/#findComment-493588 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.