PHP
-
Simple picture/file upload script
Here is a simple tutorial script that uploads a file to a folder on the server. In this example it is assumed that the file is an image and it will be outputted on screen in an img-tag. But the file uploading mechanics works for any file type.
-
How to make OSX use MAMP php instead of system version
Getting OSX to install Laravel properly is a minor nightmare. Here are some good instructions on how to get it to use MAMP php instead of the broken default one that comes with OSX. https://gist.github.com/irazasyed/5987693
-
(PHP) Simple pagination
Here’s a simple way to paginate when getting large amounts of posts from the database.
-
(PHP) Simple gallery with thumbnail generation
This is an enhanced version of this It’s a VERY simple php gallery. You could develop it in any direction. This one only supports jpg, but that could be augmented as well. Here’s what it does: Allows the user to choose an image and enter a title (or caption). Uploads the image to a folder…
-
Simple function to see if a number is Even or Odd.
Sometimes you need to check if a number is even or odd. A simple way to do this is using the modulus operator (the %-sign). It will calculate and return the remainder when dividing a value with another value. So how do you use that to find out if a number is even or odd?…
-
(PHP) Simple e-mail contact form.
A simple contact form, just for reference. Will add more info later on… [php] <?php if (isset($_POST[‘submit’])) { $name = $_POST[‘name’]; //name of sender $email = $_POST[’email’]; //e-mail of sender $email = stripslashes($email); $subject = $_POST[‘subject’]; //e-mail subject $subject = str_replace(array("\r\n","\r","\n"), "", $subject); //remove any linebreaks to keep from code injections $message = $_POST[‘message’]; //…
-
(PHP) How to make a simple gallery
This is just a VERY basic gallery that you can modify to suit your needs. For example you could add columns in the database and store more info about the images (date, size, tags etc.). You could very easily make the output use Lightbox or similar images viewers. And you could of course do a…