etsted Posted March 3, 2014 Share Posted March 3, 2014 how can i give users the ability to delete files they have uploaded? Link to comment Share on other sites More sharing options...
etsted Posted March 3, 2014 Author Share Posted March 3, 2014 basiclly, i want them to have a profile page where they can watch they're own files, and delete them if they want Link to comment Share on other sites More sharing options...
thescientist Posted March 3, 2014 Share Posted March 3, 2014 So, what do you have so far? Do you have it so people can at least upload the files and "watch" them? Link to comment Share on other sites More sharing options...
etsted Posted March 3, 2014 Author Share Posted March 3, 2014 yes Link to comment Share on other sites More sharing options...
thescientist Posted March 3, 2014 Share Posted March 3, 2014 (edited) ok, so what do you have then? What have you tried? What are you stuck on? I'm not exactly sure what you need help with. Edited March 3, 2014 by thescientist Link to comment Share on other sites More sharing options...
etsted Posted March 3, 2014 Author Share Posted March 3, 2014 how do i create that button that allows user to delete they're own files Link to comment Share on other sites More sharing options...
etsted Posted March 3, 2014 Author Share Posted March 3, 2014 select and delete they're own files Link to comment Share on other sites More sharing options...
thescientist Posted March 3, 2014 Share Posted March 3, 2014 (edited) Well, how do you think it should work? What do you think a good UI experience is for the user? Maybe a list of the files with checkboxes next to them?The checked files then get submitted and the files deleted from the server? Â Ultimately you're just going to be calling unlink at the end of the day, getting the files to be deleted is all based on your application. How are the files mapped to a user? Is there an uploads table with a record for every file, with a foreign key to a user ID? Will you delete the records if you delete a file? Â So, if all you needed was the know about unlink, then you should be set. Otherwise, provide more information and code with specific issues you are having with the implementation of what you're trying. It's not really productive to be playing 20 questions with you. Edited March 3, 2014 by thescientist Link to comment Share on other sites More sharing options...
etsted Posted March 4, 2014 Author Share Posted March 4, 2014 i have a site where all of a persons files are displayed. how do i make a checkbox next to each of them, so that they can select that one, and delete it? Link to comment Share on other sites More sharing options...
etsted Posted March 4, 2014 Author Share Posted March 4, 2014 if(isset($username)){$query = mysqli_query($con, "SELECT * FROM videos WHERE user='$username'") or die(mysqli_error());while($row = mysqli_fetch_array($query)){$title = $row['title'];$url = $row['url'];$description = $row['description'];$description = nl2br($description);echo "<h2>".$title."</h2><br />";echo "<div style='margin-left:30%;'><embed src='$url' height='250' width='250'></div><br />";echo "<strong style='font-size:1.5em;'>Description:</strong> <br />".$description;}}else{echo "<p>You must be logged in to view this page.</p>";}this is my code, but i dont know how to make a checkbox next to each of the picture, and have a button so they can choose whichone to delete Link to comment Share on other sites More sharing options...
thescientist Posted March 4, 2014 Share Posted March 4, 2014 you should probably look at the HTML tutorials to see how you can make a form and submit it via PHP. It should also cover how to create an input checkbox. The value can be the path to your file. Then on the server side you loop through all the paths and unlink them. Link to comment Share on other sites More sharing options...
etsted Posted March 4, 2014 Author Share Posted March 4, 2014 How would i connect a checkbox to a file? Link to comment Share on other sites More sharing options...
thescientist Posted March 5, 2014 Share Posted March 5, 2014 (edited) I already gave you that answer. Edited March 5, 2014 by thescientist Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now