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.. 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??? } 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 Link to comment https://forums.phpfreaks.com/topic/94363-unlink-help-please/#findComment-483294 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.