Posts

Showing posts from February, 2025

Websites to find free high resolution stock-images

 We always prefer good, high quality stock-images for our websites, blogs, print designs and may be for some other graphical work. Getting good images always cost a lot. Alternatively there are some websites which offer free images called ‘ Public Domain Images’. Public domain images are not covered by intellectual property ( Creative Commons license ) or copyrights which mean these can be used anywhere without any copyright issues. Here are the few websites to get public domain stock-images. Pixabay   All images and videos on Pixabay are released free of copyrights under Creative Commons CC0. You may download, modify, distribute, and use them royalty-free for anything you like, even in commercial applications. Attribution is not required. URL: www.pixabay.com Publicdomainarchive   You can get vintage and modern free photos from this website. It is a place to find inspiration and photography that you can re-use in your creative projects. URL: www.pu...

How to upload image and PDF file using PHP

 Here is a PHP script that allows users to upload image and PDF files with a maximum size of 5 MB. The uploaded files will be renamed using the current timestamp: <?php if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_FILES["file"])) { $allowedExtensions = array("jpg", "jpeg", "png", "pdf"); $maxFileSize = 5 * 1024 * 1024; // 5 MB in bytes $targetDirectory = "uploads/"; $timestamp = time(); $targetFileName = $timestamp . "_" . basename($_FILES["file"]["name"]); $targetPath = $targetDirectory . $targetFileName; $fileExtension = strtolower(pathinfo($targetFileName, PATHINFO_EXTENSION)); if (in_array($fileExtension, $allowedExtensions) && $_FILES["file"]["size"] <= $maxFileSize) { if (move_uploaded_file($_FILES["file"]["tmp_name"], $targetPath)) { echo ...