unix-xterm2

UNIX Basic Tutorial

UNIX Introduction What is UNIX? UNIX is an operating system which was first developed in the 1960s, and has been under constant development ever since. By operating system, we mean the suite of programs which make the computer work. It is a stable, multi-user, multi-tasking system for servers, desktops and laptops. UNIX systems also have […]

php

PHP Basic Tutorial

Chapter 1 – Introduction to PHP What is PHP? PHP Requirements How to Create A PHP File Chapter 2 – PHP Syntax Opening/Closing PHP Tags PHP Instruction Termination PHP Comments PHP Whitespace Chapter 3 – PHP Basics PHP Variables The Echo Statement PHP Strings PHP Operators Chapter 4 – PHP Conditions & Loops If Else […]

php

How to Create Image Thumbnails

Image thumbnails are basically a smaller size copy of a larger image. They can be created using PHP GD Library functions alongside a file system function that we already learned about. The getimagesize() file function will return the dimensions of the image specified. It can be used together with the list() function to minimize code […]

php

How to Add Image Filters & Effects

The imagefilter() function can be used to apply various fun and/or useful effects to an existing image or photograph. The selection of effects is: Parameter Description Arguments IMG_FILTER_NEGATE Reverses All Colors of the Image IMG_FILTER_GRAYSCALE Converts the Image Into Grayscale IMG_FILTER_BRIGHTNESS Changes the Brightness of the Image Use arg1 to Set the Level of Brightness […]

php

How to Add Text to An Image

In order to add text to an image, you need two things: the image and the font. For our example, we will use an existing image, rather than creating our own. We will also need a “.ttf” font file (of any font type/style that you want) uploaded to the server that your script will be […]

php

How to Draw Shapes On An Image

Drawing squares, rectangles, circles, ellipses and polygons are all fairly simple using PHP’s GD Library functions. First, let’s create a 300px by 300px image, allocate two different colors (grey and green), fill up the image with the grey color, send it to the browser, and clear the memory: <?php header(‘Content-type: image/png’); $png_image = imagecreate(300, 300); […]

php

How to Draw Lines On An Image

Before we begin drawing on our image, there are two functions that we should consider, for added variety. 1. Line color can be modified using the imagecolorallocate() function, which we learned about before. It should be stored in a variable to be used later. 2. Line thickness can be modified using the imagesetthickness() function, which […]

php

Creating An Image With the PHP GD Library

The three standard type of images that can be created from scratch with the PHP GD Library are: JPG, GIF and PNG. JPG Is Designed to Compress Full-Color Images, & Is Ideal For Digital Photos, Etc. GIF Is Designed to Support Only 256 Colors, Along With Transparency, Interlacing & Animation PNG Is Designed As An […]

php

GD Library Function Reference

The “GD Library” is the most used image-processing tool in PHP, allowing the dynamic creation and editing of images, charts, thumbnails, etc. The file types that can be created and/or edited using the GD library are GIF, JPEG and PNG. The GD library will be included with most PHP installations. To confirm if the GD […]

php

MYSQL Security & Handling User Input

Last, but not least (in fact this might be the most important step of all), I would like to caution you about handling user input, or allowing random people to put random data into your database queries. Why might you do that? Every time you use a website’s search feature to enter in your search […]