Types of files with php?

OK, I'm fighting for a solution to this using php as my head spinning.

I can do using jquery but would prefer to use php. I'm deleting entries in a database based on the id (that part works very well):

< input type = "checkbox" name = "[to] holiday_id" class = "holiday_id" value = "<?" PHP echo $row ["holiday_id"];? > ">"

$holiday_id = $_POST ['holiday_id'];

{foreach ($holiday_id as $holiday_id)}

$stmt = $conn - > prepare ("DELETE FROM holiday WHERE holiday_id =?");

$stmt-> bind_param('i',$holiday_id);

$stmt-> execute();

}

Then I need to erase the images of the holiday from the server (multiple images), that's why I use a loop foreach that are associated with the holiday_id, something like below:

$deleteImage = $conn-> query ("" SELECT holiday_image FROM holiday WHERE holiday_id = ' $holiday_id ' "") or die ($conn-> error);

{foreach ($deleteImage as $deleteImage)}

unlink("..) (/ assets/holiday_images/".$deleteImage);

}

Obviously the above does not work as the table/loop is not correct, but for the life of me I can't find the right combination. Should be simple.

At the moment that I did successfully using another check box 'hidden' on the page directly after the first box and jQuery check the following box, which work very well, but is messy ucking.

< input type = "checkbox" name = "holiday_id []" iclass = "holiday_id" value = "<?" PHP echo $row ["holiday_id"];? > ">"

< input type = "checkbox" name = "deleteFile []" class = "holiday_image" value = "<?" PHP echo $row ["holiday_image"];? > ">"

< script >

$(document) .ready (function () {}

$('input[type=checkbox]').click (function () {}

.next('input[type=checkbox]').Attr $(this) ("checked", true);

});

});

< /script >

Remove the image file that is associated with the party

$deleteFile = $_POST ["deleteFile"];

{foreach ($deleteFile as $deleteFile)}

unlink("..) (/ assets/holiday_images/".$deleteFile);

}

See you soon

Operating system

Yah, cleared my head and came back to her. It comes to getting everyting in the right order. This kind of things can have tied you in knots sometimes but the trial error, and does not have ultimately prevailed. The solution:

$holiday_id = $_POST ['holiday_id'];

{foreach ($holiday_id as $holiday_id)}

$deleteFile = $conn-> query ("SELECT * FROM holiday WHERE the holiday_id = ' $holiday_id '") or die ($conn-> error);

$deleteFile = $deleteFile-> fetch_assoc();

$deleteFile = $deleteFile ["holiday_image"];

unlink("..) (/ assets/holiday_images/".$deleteFile);

$stmt = $conn-> prepare ("DELETE FROM holiday WHERE holiday_id =?");

$stmt-> bind_param('i',$holiday_id);

$stmt-> execute();

}

Tags: Dreamweaver

Similar Questions

  • Ignore certain types of files with Windows Media Player

    When I'm in a hurry I get all the files in a folder and drag it to the Windows Media Player.  The files include the jpgs as album art.  When Windows Media Player encounters a file he doesn't know how to manage it up an error 'the Player Windows Media has encountered a problem reading the file'.

    How to make Windows Media Player to ignore certain file types?

    With a single click, you can sort files by type of file that would make easy is not to include them in your list of drag.

    John

  • code snippets in color behavior plan DW in file with php

    Hello

    I have a PHP file loaded in DW.

    In this file are several HTML + PHP code snippets.

    The color scheme (on screen) of the HTML components is not the same in different parts of this file... Is this normal... or is it a mistake?

    It seems that the file is OK running in php.

    question:

    Snippets of HTML code of the system color (ie) are identical in all of the file?

    Fred K. says:

    Hello

    I have a PHP file loaded in DW.

    In this file are several HTML + PHP code snippets.

    The color scheme (on screen) of the HTML components is not the same in different parts of this file... Is this normal... or is it a mistake?

    It seems that the file is OK running in php.

    question:

    Snippets of HTML code of the system color (ie) are identical in all of the file?

    Looks like there is probably an error in your markup somewhere. Snippets of html code must be the same color except that you generate a script to mail electronic html or maybe a message of the form.

    If there is an error in the supplement of php, it would be unusual for the page to show anything it either - look so the html code.

    EDITED.

    In FACT if you are echoing of html with php elements that might be a different color, usually red in DW, identical to the php code.

  • Cannot open files with .php extensions

    Internet Explorer blocks the download of a file, static.ak.fbcdn.net and if I allow the download of what he asks me to find a program to open xd_proxy.php.  My computer is not a program that can open a php file.  She reminds me of a site microsoft on the web who told me that he cannot stand the programs with the .php extension.  Then what should I do?

    Internet Explorer blocks the download of a file, static.ak.fbcdn.net and if I allow the download of what he asks me to find a program to open xd_proxy.php.  My computer is not a program that can open a php file.  She reminds me of a site microsoft on the web who told me that he cannot stand the programs with the .php extension.  Then what should I do?

    THIS FREE PROG WILL OPEN THEM also try windows Notepad

    http://Notepad-plus-plus.org/

    A PHP file is like any other text file you may know. So, you can use easily available programs such as Notepad on Windows or TextEdit on aMac, to open a PHP file. You can also use these programs to edit and save the PHP file. In addition, there are a multitude of programs specifically designed for editing PHP files.

    To open a PHP file in Notepad, first launch the Notepad application. In Notepad, select file, open in the menu bar. Navigate to the folder where you saved the file PHP. You will notice that the file does not appear in the list. To see the PHP file, you will need to change the extension to all files by using the dropdown next to the file name field. Now you should be able to select your PHP file, then click Open.

    Read more: http://www.brighthub.com/internet/web-development/articles/62614.aspx#ixzz1D7CYHUsr

  • How one manually associate the file with an application types?

    I recently installed the Adobe Digital Editions software to download an e-book I bought. It will not open in ADE, and the manual of the ADE advises me to "manually associate the" types with the application of the EPUB files and the subsidies agreement. 'See the instructions for your operating system for associating file types'. I can't find the instructions for it anywhere. HELP, please.

    Support cat either does not!

    Click context (right click) on the file and the menu should give you one option 'Open with' - at the end of which is 'Other' - which should allow you to engage in the type of file you want

  • Colour varies with the type of file

    I have an Office Jet Pro 8600, which is about 1.5 years old.  It allows to print PDF files perfectly but JPGs, MS Publisher are distorted in this red appears yellow to orange.  I haven't checked the other types of files.

    I cleaned the print head, and finally the diagnosis told to replace the print head.  However, it prints the PDF (and maybe others) just drop off.  Black works very well too.

    Do I need a new printer or?

    David

    My bad.  It wasn't printing the files OK.   The test file, I chose didn't need any magenta ink and so I see no problem.  HP sent me a necessary printing head and fortunately my printer is still under warranty, so everything should be OK within 5-7 business days when the new leader arrives.  My apologies and please ignore all this.  David

    My bad.  It was NOT OK for pdf printing.  I got to choose one with no red (magenta), which was what was screwed up in the print head.  With HP cat and they went through it with me.  Need print head is on it way for me.

    Sorry for the inconvenience.

    David

  • Save my pictures worked with adobe photoshop 9. keeps telling me unable to open, the wrong type of file and it says it's a "file 2" - How can I change this please

    How can I change the type of file it becomes an adobe raf or raw file, it worked with the camera but the pc is save them as files of type 2 and photoshop 9 does not open these.  I have a fuji s2 pro if it's any help, thank you.

    http://www.Adobe.com/support/downloads/product.jsp?product=106&platform=Windows&promoid=HTENB

    You can use the free DNG Converter from Adobe, download the file above.

    DNG is digital negitive and it's open in Camera Raw Editor.

    This converter supports more than 500 different types of camera.

    If someone sends you a raw file and your Raw editor does not support this type of camera, you use the converter.

    Once converted, you can open it.

    http://helpx.Adobe.com/Creative-Suite/KB/camera-raw-plug-supported-cameras.html

    The list above shows FinePix S2 Pro, RAF file type,

    A plug-in version Camera Raw minimum required 1.0

    http://helpx.Adobe.com/x-productkb/global/camera-raw-compatible-applications.html

    The list above shows Photoshop Elements 9 comes with the Camera Raw plug-in version ... 6.1

    Compatible with Camera Raw-plug-in, thanks to the version... 6.5

    http://helpx.Adobe.com/cfusion/search/index.cfm?loc=en_US&term=elements%209%20raw%20update

    The list above shows that there is an update to Camera Raw in Photoshop Elements 9... 6.3 or 6.5... 6.5 it is better.

    It also shows an update for first items 6.4.1 9 If you who also have.

    You can also get updates through the app.

    However you do not have these updates now since your comes with the version is 6.1 and the

    Plug in Camera Raw minimum required version is 1.0

    OK... so it shows your camera has not been defined to take RAW images or you downloaded the wrong file in Photoshop.

    Most cameras that take RAW images have a framework for Raw images only or adjustment to take RAW images and regular at the same time.

    Test your camera again files for RAF types and if you do not check your settings of the camera again.

    You can not save or convert a regular image as a type RAW or DNG file.

    http://forums.Adobe.com/index.jspa?promoid=JOPCT

    I am a member of the Adobe forums, help is very good, the link above will take you there.

    I hope that helps.

  • I get videos from cell phones of the people with a type of file like 3GP. I need to know how to save and change the format so I can open them.

    I get videos from cell phones of the people with a type of file like 3GP. I need to know how to save and change the format so I can open them.

    Trying to convert to the. WMV format:

    There are many converters available on the net... some
    free... some detail.

    The following freeware converter is just one example:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Format Factory (freeware)
    http://www.videohelp.com/tools/Format_Factory
    (the 'direct link' is faster download)
    (the file you want to download is: > FFSetup295.zip<>
    (FWIW... installation..., you can uncheck
    ('all' boxes on the final screens)
    (Windows XP / Vista / 7)

    First, you will need to decompress the file or just open the
    Drag > FFSetup295.exe< out="" of="" the="">
    and drop it on your desktop. To install left click.

    Next, after the download and installation of Format
    Factory... you can open the program and
    left click on the toolbar, the "Option" button and
    "Select an output folder to" / apply / OK.
    (this is where you find your files after they)
    are converted)

    Drag and drop your video clips on the main screen...

    Select "all to WMV" / OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    Good luck...

  • Getting the error "this file does not have a program associated with it for performing this action" when choosing "open with" from the context menu on any type of file

    I get this error since I uninstalled an application called DriverCure. Now when I choose 'open with' any type of file I get this error this is really boring, I also tried reinstalling the app and also do a system file check, but it was of no use.

    Hello

    Thanks for posting your query in the Microsoft Community Forums.

    According to the description provided, I understand that you are unable to open any type of file on the Windows 7 computer. I will certainly help you in this regard.

    You can deal with these issues, if the file is corrupted. I would refer you o suggest the help article and run the Fixit tool.

    When you run an .exe on a Windows XP, Windows Vista or Windows 7 computer file, the file can start another program

    http://support.Microsoft.com/kb/950505

    Note: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base. How to back up and restore the registry in Windows:
    http://Windows.Microsoft.com/en-us/Windows7/back-up-the-registry

    Back to us for any problem related to Windows. We will be happy to help you. We at Microsoft try to provide our customers the best experience.

  • How to get the Types of files - not associated with the applications Adobe CC

    How can I prevent Adobe creative cloud files of type to come in my research.

    I don't know how to use I or PS I accidentally a license and an image that cannot be opened with the help of HAVE or EPS (which makes all this shit even average?)

    I just want some png or JPEG files or any files can be used without having to use adobe software.

    So now I'm forced by Adobe to pay $22.99 per month for access to their software, just so that I can open a picture - what the mini-bars

    I'm not a designer, I can't use these programs, I want just the images that I can use on my site - is it so difficult?

    It is very easy in fact. Just deselect "Vectors" in your search. Which will remove all the .ai files. The rest you can use without any Adobe applications at all.

    And to be sure, every detail of the image indicates the type of file. If she says .ai/.eps you probably don't want to.

  • I create a logo for a company, but I'm new to illustrator and don't know what type of file to give them for their personal use if themselves don't have Illustrator to work with

    So I designed a logo for a company, they want to buy too! I don't know what type of file to send to them for their personal use. I am new to illustrator, so I'm not sure whether it should be a .png, .pdf or .svg. They don't have access to Illustrator, so they would not be able to view the native .ai file, how can I send the file?

    Whenever I have provide a customer with a logo, my first question that would be what they are they who need for?

    And when you have the response from them, it will give you a good idea of what to provide.

    Second to that I will always create a logo set to compile something like the following:

    1. Original .ai logo - RGB/CMYK/Black/White versions
    2. A set of PNG with transparent backgrounds of different sizes (something like 100px, 250px, 500px, 1000px wide)
    3. A set of .jpg in various sizes (something like 100px, 250px, 500px, 1000px wide)
    4. And now a .svg and .pdf file

    Once again it all depends on what the customer wants it, but once you have furnished with everything that they are able to use it for the most part.

    Good luck

  • When I tried to open the bought one of the files with Adobe Reader purchase ebook, he said Adobe Reader could not open ' URLlink (2) .acsm ' because it is not a type of file supported or because the file has been corrupted (for example, it was sent

    When I tried to open the bought one of the files with Adobe Reader purchase ebook, he said

    Adobe Reader could not open ' URLlink (2) .acsm ' because it is not a type of supported file or because the file has been damaged (for example, it was sent as an attachment to e-mail and has not been correctly decoded).

    Adobe Reader can open PDF files; for the .acsm file, you need Adobe Digital Editions.

  • File saved under type fichier.5 with CS5, how open in CS5

    I worked on a certificate and I recorded it without looking at the file type. For some reason any he defined file type (. 5). What is c? Is there a way I can open it again in CS5? Is there a file converter I could use. I just need to basically open again in CS5 so I can continue to change the certificate. I tried to open the file with CS5 and CS6 and I get this message:

    "Could not complete your request because it is not the right kind of document."

    Thank you!

    You have a computer configured to display or hide the extension?  When indicating the assignment rename xxxx.5 in xxxx.tiff for example.

  • How to rename multiple files with the extension in windows xp

    How to rename multiple files with extension in windows XP.

    1. If you want to simply rename the extension, open a run window (Windows Logo key + R), type cmd and press ENTER. Using the CD (Change Directory) command, navigate to the folder in question. Now, type ren *.mp3, *.mp4, and press enter (note the two spaces in the command). Note, rename mp3 MP4 is just an example of the command.

    2. If you want to rename files, download the 32-bit version or 64-bit Bulk Rename, here http://www.bulkrenameutility.co.uk/Main_Intro.php

  • Best types of files, size etc. of import in InDesign, etc.

    Hello

    Given that my computer is to thrust then with files that are too big (old files that I created when I wasn't aware of the best ways to reduce the size of the file, etc..) I have a few questions.

    • A lot of my files is. EPS, but in this case, I have the original in file. PSD or. PDF (both possible to place in InDesign files). What is the best type of file to be placed in InDesign, because having the same design and in. PSD and in. EPS seems a little stupid to me?
    • What are the best options to place images and files in an InDesign file without creating a huge PDF file afterwards?
    • What are the best options to place files and images in a Photoshop file without making it huge?

    Who can advice me some sites or books that can tell me all about this topic? Since I started my own Graphic Design business, it is a very important subject to me because the file size optimization is something that I still have a lot of problems with!

    Thank you guys!

    to start:- http://indesignsecrets.com/tiff-vs-psd-vs-eps-vs-pdf-vs.php

Maybe you are looking for

  • Select bookmarks to be sorted alphabetically

    In Internet Explorer, you can right click on the bookmark or a sub entry and choose "Sort by name" to the alphabetical entries. I think it would be great in FFIt is on 'Bookmarks Toolbar', but grayed out

  • HP 6530 b: do not charge the battery and the wont run on AC

    When it is directly plugged in AC or docking station (separate power cords), my laptop started to operate on battery only and there sropped of charge. If the battery is removed, the device will not fuel in docking station or directly connected to the

  • Desktop windows Manager seems dull after reinstall. Maybe lack file... help!

    Hello!!! I have recently completely reinstalled vista because of some problems with my computer, some were viruses, and some were inherent problems with vista itself. In any case, since I reloaded vista, everything works well except that my desktop w

  • Remote VPN connected but do not go anywhere.

    within the network - ASA5505 = internet = remote VPN client. The ASA has a public IP address on the external interface and using PAT to the internet. He has only two interfaces, both inside and outside using the vlan. I created an IPSec VPN through C

  • Can not remove the brush color tint

    I have a picture that has been created by someone else. It has brush strokes applied to him, which gives it a nice tapered lines. I want to keep these traits, but I can't get their colors to change correctly.When I go to change the features or the br