Nice logic kinda figured what u gonna do halfway ,now with each video i am learning something new like hey that's where u use 'string.replace or unlik, or glob' etc. Cool
On previous tutorials you used die() instead of exit(). I did a quick Google search and both functions do the same. Is there an specific reason why you used exit() in this tutorial but used die() on all of the other tutorials? Thanks for the videos btw! Cheers!
Thanks for your tutorials, found and LOVE your channel. Especially this PHP series, It would be great to see a cURL tutorial, and connecting with API's tutorial in the future :) Cheers!
But how would you know what file is missing using in_array? I think with for loop you can even print this missing file.... I'm not you can do that with in_array. If you can please explain cause I'm new to php and that would be helpful. Thanks!
@@turbosardar39 It's been a while since I've watched this but whatever file you're looking to see if it exists is the one that exists. In other words you're comparing the array to something,. That something is the file.
@@ComputerHelpHawaii the video is about deleting multiple files...so we need if all files exists...if it was only one file in that case in_array would be efficient...but in case of multiple files i think for loop is more efficient as you can even print the name of the missing file.
@@turbosardar39 I don't know. Do you want a foreach loop going through each file looking for a match or do you just want to know if it exists, but jmo for what it's worth. I'm so busy I may have misinterpreted and you could be absolutely correct. Good luck with your education process which by the way never ends :-)
in 11:34 , if the "if statment" is true , we go to header and to another page ( index.php) and leave this page (and this loop ) , why we need the "exit() " function ?
how do I delete a certain line/object from a txt file? I am creating my guest book with OOP PhP, and I am trying to solve my delete button, where I delete a chosen post, each post is it's own html table row, and I also want to delete the object within the txt file (my database), but I am completely stuck and could use some tips..
Hey, can't I just use the file selector and select the file and post it out to the deletefile.php and get the name of the file through $file['name'] and make the path this : $path = "uploads/".$filename; then I can unlink the file like I did in the previous video. why would I need to do so much work and type out each file name in order to delete files? shouldn't I just select them through the file selector?
Thasan That won't work since we are searching inside the uploads folder. However to make it completely safe I would recommend also doing a check to make sure only certain files with specific extensions can be deleted.
Thasan Yeah I thought about the ../ before going to bed. I would create an error handler identical to the str_replace we did in this episode that removes any ../ from the string :)
Nice logic kinda figured what u gonna do halfway ,now with each video i am learning something new like hey that's where u use 'string.replace or unlik, or glob' etc. Cool
the script become easier if you use a foreach loop instead the for loop, and using the all the first loop you can control and delete the files
On previous tutorials you used die() instead of exit(). I did a quick Google search and both functions do the same. Is there an specific reason why you used exit() in this tutorial but used die() on all of the other tutorials?
Thanks for the videos btw!
Cheers!
Thanks for your tutorials, found and LOVE your channel. Especially this PHP series, It would be great to see a cURL tutorial, and connecting with API's tutorial in the future :) Cheers!
really liked your tutorial
Question about the first for loop on line 7. You said you're just looking to see if it exists so wouldn't in_array be faster?
But how would you know what file is missing using in_array?
I think with for loop you can even print this missing file.... I'm not you can do that with in_array.
If you can please explain cause I'm new to php and that would be helpful.
Thanks!
@@turbosardar39 It's been a while since I've watched this but whatever file you're looking to see if it exists is the one that exists. In other words you're comparing the array to something,. That something is the file.
@@ComputerHelpHawaii the video is about deleting multiple files...so we need if all files exists...if it was only one file in that case in_array would be efficient...but in case of multiple files i think for loop is more efficient as you can even print the name of the missing file.
@@turbosardar39 I don't know. Do you want a foreach loop going through each file looking for a match or do you just want to know if it exists, but jmo for what it's worth. I'm so busy I may have misinterpreted and you could be absolutely correct. Good luck with your education process which by the way never ends :-)
Thanks.. your tuts solving my problem.
Very helpful. Thanks
Thanks :)
can you make a video how to delete multiple data and image from database and folder using checkbox thx
Thanks for your tutorials, now I think I can code a php file that can delete my friend's dota2 root folder.
and tell me how , this code is only for separatet files not a folders...
you are so great ... thank you sir
Hey. I was just wondering what is the name of your keyboard? :p
Hello sir i want to use this code in table row for deleting rows. Help me.
in 11:34 , if the "if statment" is true , we go to header and to another page ( index.php) and leave this page (and this loop ) , why we need the "exit() " function ?
I have an exit function after calling another script just in case in one of my more recent scripts.
Thanks for your good work done, but i would like you to assist me in building a tracking system. i will be looking forward to hear from you thanks.
whitch line mus be edited for delete folders. I need deleted folder not only files ..
What is your code editor name...???
Thank u...😊
Hi i have "permission denied error on unlink function" what should i do?
8:15 can you not like use a for each loop instead of using that method
how do I delete a certain line/object from a txt file? I am creating my guest book with OOP PhP, and I am trying to solve my delete button, where I delete a chosen post, each post is it's own html table row, and I also want to delete the object within the txt file (my database), but I am completely stuck and could use some tips..
Have you solved it?
@@turbosardar39 yeah I did :) you having the same problem?
Hey, can't I just use the file selector and select the file and post it out to the deletefile.php and get the name of the file through $file['name'] and make the path this :
$path = "uploads/".$filename;
then I can unlink the file like I did in the previous video.
why would I need to do so much work and type out each file name in order to delete files? shouldn't I just select them through the file selector?
I was thinking the same thing. Did you implement this idea?
I am going to have a go at it...
@yusef 258 thanks bro
Cool
What if I enter index.php to filename?
Thasan That won't work since we are searching inside the uploads folder. However to make it completely safe I would recommend also doing a check to make sure only certain files with specific extensions can be deleted.
mmtuts oh.. thats true, didint noticed it was on upload folder.. So, ../index.php
Thasan Yeah I thought about the ../ before going to bed. I would create an error handler identical to the str_replace we did in this episode that removes any ../ from the string :)
I just added an annotation to the video that shows how to avoid users going back a folder :) Thanks for pointing it out.
i got permission denied :/