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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.