techker Posted March 4, 2008 Share Posted March 4, 2008 hey guys i need info on how to incorparate a variable in this. $fileToRemove = " picture.jpg"; if (file_exists($fileToRemove)) { // yes the file does exist unlink($fileToRemove); } else { // the file is not found, do something about it??? } ok so my script is an uploader that upload images and puts the info in a database.the file is moved to a folder. now i can delete the info but not the pic so im calling the unlink function in my delete file i call to the url with a get now i wan't to do the same in my delete picture. in my delete .php $delRT = "DELETE FROM employees WHERE numero = ".$_GET['numero'].""; now i wan't to put in the unlink .$_GET['photo']." cause it contains the pic name but when i try to put it in between the ' ' it gives me an error.. Quote Link to comment https://forums.phpfreaks.com/topic/94363-unlink-help-please/ Share on other sites More sharing options...
Chris92 Posted March 4, 2008 Share Posted March 4, 2008 $fileToRemove = "{$_GET['photo']}"; if (file_exists($fileToRemove)) { // yes the file does exist unlink($fileToRemove); } else { // the file is not found, do something about it??? } Quote Link to comment https://forums.phpfreaks.com/topic/94363-unlink-help-please/#findComment-483285 Share on other sites More sharing options...
techker Posted March 4, 2008 Author Share Posted March 4, 2008 i juste noticed that it works without the{} to thx for the quick reply Quote Link to comment https://forums.phpfreaks.com/topic/94363-unlink-help-please/#findComment-483294 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.