Jump to content
#StayAtHome ×

sagar_24

New Members
  • Content Count

    9
  • Joined

  • Last visited

Everything posted by sagar_24

  1. Haha You'll be rich anyways. I know the college is too bad to care But this project is like a notice board to keep students updated so only the admin will have the ip or access to do it and so not to misunderstand any basics i'm using glob instead of get now
  2. Thanks You so much for the info sir and as i'm a noob i'll surely understand security norms of http as time goes But for now this is just a college project that i'm working on and the real life implementation only requires the admin to make all changes that's the reason i'm not concerned with my script security here But i do appreciate the knowledge
  3. My first try was with glob but in my case glob wasn't able to locate the directory so i went ahead with this could you give me a link or example or glob similar to my case appreciate the reply
  4. Right when i saw this i was sure this is what i wanted unfortunately it didn't work thanks for replying though
  5. Sorry My bad i'll take it down about the answer could you give me an example or link me to something please? thanks
  6. Could you give some example or link me to something? it's really important and i'm a noob thanks
  7. I want to delete files(Image File) with different extensions(like jpg,png) having same name. I don't know what's wrong My code seems alright. Here I'm taking the file name from HTML HTML: <a href="123.php?file=2"><button class="btn2">Delete File:2</button></a> PHP: <?php $base_directory = 'uploads/'; if(unlink($base_directory.$_GET['file*.*'])) echo "File Deleted."; ?> And I've even tried passing the extensions through HTML as well, which felt quite alright too. But didn't work at all Please shed some light on what seems to be the problem would appreciate it. HTML: <a href="123.php?file=2.jpg && file=2.png"><button class="btn2">Delete File:2</button></a> PHP: <?php $base_directory = 'uploads/'; if(unlink($base_directory.$_GET['file'])) echo "File Deleted."; ?>
  8. So, here i am trying to display the uploaded images to my server by using slideshow script. However, for instance file '3.jpg' is not present in my file i want to skip it instead displaying a blank page. I've tried visiblity:hidden instead of none but no luck! Please shed some light about what the problem is..would appreciate it! Here is my code..Please forgive me for the messy code I'm learning. <!DOCTYPE html> <html> <title>LOL</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet"> <style> .mySlides {display:none;} div { top:0; left:0; width:100vw; height:1000vh; background:black; display:table-cell; vertical-align:middle; text-align:center; } img { max-width:100%; height:auto; max-height:100%; margin: 0 auto; } </style> <body> <meta http-equiv="expires" content="10" /> <div class="w3-content w3-section" style="position:fixed; height: 100%; width: 100%;"> <img class="mySlides" src="uploads/1.JPG" align="middle"> <img class="mySlides" src="uploads/1.jpg" align="middle"> <img class="mySlides" src="uploads/1.png" align="middle"> <img class="mySlides" src="uploads/1.PNG" align="middle"> <img class="mySlides" src="uploads/2.JPG" align="middle"> <img class="mySlides" src="uploads/2.jpg" align="middle"> <img class="mySlides" src="uploads/2.png" align="middle"> <img class="mySlides" src="uploads/2.PNG" align="middle"> <img class="mySlides" src="uploads/3.JPG" align="middle"> <img class="mySlides" src="uploads/3.jpg" align="middle"> <img class="mySlides" src="uploads/3.png" align="middle"> <img class="mySlides" src="uploads/3.PNG" align="middle"> <img class="mySlides" src="uploads/4.JPG" align="middle"> <img class="mySlides" src="uploads/4.jpg" align="middle"> <img class="mySlides" src="uploads/4.png" align="middle"> <img class="mySlides" src="uploads/4.PNG" align="middle"> </div> <script> var myIndex = 0; carousel(); function carousel() { var i; var x = document.getElementsByClassName("mySlides"); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } myIndex++; if (myIndex > x.length) {myIndex = 1} x[myIndex-1].style.display = "block"; setTimeout(carousel, 1000); // Change image every 2 seconds } </script> </body> </html> Note-I've used same file with different extensions just because i can't use && or || here if you have any alterations please mention it.
×
×
  • 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.