54: How to delete files from folder - PHP tutorial

  Рет қаралды 59,534

Dani Krossing

Dani Krossing

Күн бұрын

Пікірлер: 38
@crack9058
@crack9058 8 жыл бұрын
Your PHP whole sessions are incredible till now .
@Dani_Krossing
@Dani_Krossing 8 жыл бұрын
Thank you :) I'm glad you think so.
@SpaceSlug_
@SpaceSlug_ 3 жыл бұрын
Am currently studying and all your videos have been such a help. Thanks my dude!
@mariamzayed91
@mariamzayed91 4 жыл бұрын
thank youuu🥺 i actually watched the whole ads to thank u
@Soulof8d
@Soulof8d 3 жыл бұрын
🔥😁
@gustavomarquesdasilva1167
@gustavomarquesdasilva1167 7 жыл бұрын
this actually worked. Good tutorial. Very straightforward. Thanks.
@fundamentalmarketersclient6945
@fundamentalmarketersclient6945 2 жыл бұрын
Thank you so much. Wonderful Video
@mwangazatv1800
@mwangazatv1800 7 жыл бұрын
You are a real programmer
@KimaniWaNdirangu
@KimaniWaNdirangu 6 жыл бұрын
Thanks Daniel.Very useful functionality.
@chaddsmith3354
@chaddsmith3354 3 жыл бұрын
Thank you for the video!
@HanoMontano1
@HanoMontano1 3 жыл бұрын
thx a lot man
@isaacquarshie2563
@isaacquarshie2563 5 жыл бұрын
It worked for me Thanks...I appreciate.. :)
@armastro99
@armastro99 8 жыл бұрын
Great video!
@Dani_Krossing
@Dani_Krossing 8 жыл бұрын
Thank you :)
@jithuwilsoncit9631
@jithuwilsoncit9631 2 жыл бұрын
Thanks it worked but I have doubt, how to implement it in CI4? How to set path for unlink('./'.$filename) when the current siiiting page address is ControllerName/something/something in URL?
@ngjhunnen
@ngjhunnen 8 жыл бұрын
nice sir... thank you so much
@deepeddyrecords5933
@deepeddyrecords5933 4 жыл бұрын
It works great for me except that after submitting, my browser goes to the deletefile.php. I fixed that by adding these lines to deletefile.php: header("Location: ../index.html"); die(); Put these two on two separate lines. Otherwise, excellent tutorial. Just what I was looking for.
@edlb10
@edlb10 6 жыл бұрын
thanks it worked
@zahirzohair1372
@zahirzohair1372 7 жыл бұрын
you are teaching really well. it is so helpful for me. but i have problem with admin authentication and user authentication in a portal. for example, a teacher as an admin can upload the assignment with instructions and specify the due date to be submitted. the student as a user only can upload the answer and maybe post a comment but cannot do any changes to the dude date of the assignments and cannot edit the instructions. how to set their authenticity ?
@Dani_Krossing
@Dani_Krossing 7 жыл бұрын
You can create separate tables to assign "user roles" to your users. This can either be done in a complicated or simple way, depending on your need. If your application is still as simple as what we have done in these lessons here, then the SQL table code bellow should be good enough. //This table creates the user role table CREATE TABLE Roles { id int(11) not null PRIMARY KEY AUTO_INCREMENT, role varchar(256) not null } //These inserts creates the roles you want to have on your website, you can just add or remove roles if you don't want them INSERT INTO Roles (role) VALUES ("Standard User"); INSERT INTO Roles (role) VALUES ("Super User"); INSERT INTO Roles (role) VALUES ("Guest"); //This table allow the roles from the previous table to get linked to users CREATE TABLE User_Role { id int(11) not null PRIMARY KEY AUTO_INCREMENT, user_id int(11) not null, assign_role varchar(256) not null } //These inserts assigns the roles from the previous table to users. The bellow line would as an example link the user with an "id" as "1", to your "Standard User" role. INSERT INTO User_Role (user_id, assign_role) VALUES ("1", "2"); With the user roles created, you just need to make sure that EVERYTIME you create a new user, they get assigned a role in the same script you use when they sign up. And then using PHP you just only allow teachers/admins (who has the "Super User" role) to specify due dates. And regarding the students you just need to make sure that "Standard Users", should only be allowed to have access to the "upload" link, before the date the teacher/admin specified. You can use one of the build in PHP date functions for this. Hope this helped!
@zahirzohair1372
@zahirzohair1372 7 жыл бұрын
thank you very much for your nice reply and valuable time! of course it helped me a lot.
@thegreenmonster650
@thegreenmonster650 6 жыл бұрын
Yolo......! it worked. Thanks.....
@АртемВолков-ю5ь
@АртемВолков-ю5ь 8 жыл бұрын
Nice)) how to delete multiple files?
@Dani_Krossing
@Dani_Krossing 8 жыл бұрын
It depends on the reason for deleting multiple files... but an example (WITHOUT using JavaScript) could be that you write the name of all the files you want to delete by adding an input to your form and separate the names by a comma (,). Then in the script when you submit the form, you just use the explode() function to separate the names and insert them into an array. Then you just loop the array using a foreach loop, and use the unlink() function inside each loop :)
@Dani_Krossing
@Dani_Krossing 8 жыл бұрын
Hi again, I am uploading an episode tomorrow morning on how to delete multiple files :)
@АртемВолков-ю5ь
@АртемВолков-ю5ь 8 жыл бұрын
Thank you))
@BalkanLeaksArchive
@BalkanLeaksArchive 2 жыл бұрын
Can you plaease record how to delete all posts older than 1 day from mysql with php every day without CRON.
@aidaspatapavicius7654
@aidaspatapavicius7654 7 жыл бұрын
help doesnt work :/
@phpcoderforever
@phpcoderforever Жыл бұрын
thank you can you help me how to update the old file means update the field in the table with the new name and unlink the old file name and upload the new file
@madcorndog
@madcorndog 5 жыл бұрын
I like watching this channel because every other channel is some guy from India with a REALLY bad mic.
@movine2344
@movine2344 6 жыл бұрын
You should work in Facebook
@misterzerocrypto4749
@misterzerocrypto4749 3 жыл бұрын
where is the update file
@eliuespinoza4016
@eliuespinoza4016 5 жыл бұрын
I need something real useful. Ex: few images (saved in a folder) displayed on the browser. Click on one of them. And that specific image is delete. With Array[i]
@guruprasath997
@guruprasath997 5 жыл бұрын
for that use SQL to select a file and then delete a file
@madcorndog
@madcorndog 5 жыл бұрын
It dont work for me. It's says there is no such file or directory BUT THERE ISSSS! AND I CHECKKED!
@elel928
@elel928 4 жыл бұрын
Same issue for me.
@ehokify583
@ehokify583 2 жыл бұрын
Great Work!
55: Delete more than one file or image in PHP - PHP tutorial
15:16
Dani Krossing
Рет қаралды 36 М.
PHP Tutorial - #71 - Deleting a Folder With Contents
6:20
Karl Hadwen
Рет қаралды 1,1 М.
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 78 МЛН
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 195 МЛН
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 309 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 11 МЛН
PHP in 60 Seconds: The Basics #php #project #technology
1:00
Dave Hollingworth
Рет қаралды 490 М.
delete image from folder when delete record in php
2:39
Amit Andipara
Рет қаралды 17 М.
I Made a Platformer, but You Can't Move Backward
10:05
Gambit
Рет қаралды 15 М.
Upload, Download and Delete File using PHP
10:07
Paul Mansour
Рет қаралды 7 М.
How to delete file in php (php unlink)
7:53
WCoderZone
Рет қаралды 33 М.
Database Security Threats: Top 10 Tips to Secure MySQL
1:26
Database Dive
Рет қаралды 2 М.
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 78 МЛН