Jump to content

digipit

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by digipit

  1. This is what I got: "../../images/gallery/ is a valid file". The weird thing is that it didn't show the file name though. Is there something wrong with the variable? Thanks for your help!
  2. picture_name is what the user adds in as a caption for the image. picture_url is the column in the db containing the actual name of the file (i.e. myimage.jpg). That's what I'm trying to delete and running into a world of trouble with it.
  3. I guess I do. I am the admin, but I've seen where others said to "chmod" it to 777. The folder itself is set to 777 but the individual images are not. I'm not sure how to go about doing this. I've also tried putting in a file directory path for the server but it still gives me fits. Any thoughts? Thanks.
  4. [b]Here's the code I've got for deleting a record in the MySQL database as well as the image associated with it on the server. The portion that deletes from the database is working perfectly, but I can't get it to delete the image off the server. This is a picture gallery I've created for a client. Getting it to delete the actual image is the last thing keeping me from finishing the project. All and any help is appreciated.[/b] [!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--]<? $db_user_name = "*****"; $db_database_name = "****"; $db_password = "****"; $picture_id = $_GET['picture_id']; $picture_name = $_GET['picture_name']; $picture_url = $title . '.' . $_GET['picture_url']; mysql_connect( 'localhost', $db_user_name, $db_password) or die('<br>Failed connect: ' . mysql_error()); mysql_select_db($db_database_name) or die('<br>Failed database: ' . mysql_error()); mysql_query("DELETE FROM pg_gallery WHERE picture_id = $picture_id") or die('<br>Failed query: ' . mysql_error()); mysql_close(); unlink('../../images/gallery/'.$picture_url); echo 'File removed successfully.'; ?>[!--colorc--][/span][!--/colorc--]
×
×
  • 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.