Jump to content

unlink help please


techker

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.