Tutorials Archives - Page 2 of 2 - LoudProgrammer

Tutorials

PHP Tutorials – How to Include Comments in PHP

PHP, Tutorials
A comment is a line of code that is not supposed to be executed as part of the program. You can use a comment to show others what you are doing or to reminder yourself of what you did. A common occurrence is where a programmer comes to look at the code they wrote on year or so down the line and they have to re-figure out what they were thinking when they wrote the code. A comment can remind you of what you were thinking. In PHP there are a couple of ways through which you can include comments in your code. Create an empty text file document and save it in your local computer using the name comments.php  and include the code below. <!DOCTYPE html> <head> <title>PHP Comments </title> </head> <body> <?php ?> &l...

PHP Tutorials – PHP Syntax

PHP, Tutorials
PHP scripts can be placed anywhere inside an HTML document. You can place them at the beginning of your HTML, inside the HTML tags or at the end of the HTML document. In this tutorial we are going to write a simple script that is going to print an "Hello World!" string to the browser to demonstrate the syntax of PHP code. You can use any text editor of your choice to write and edit PHP code. Create a new text document file and save it in your local computer htdocs folder as helloword.php . All PHP scripts must have a file extension of .php in order to executed by the server. After creating the file open it in your text editor of choice and type in the following code: <html> <head> <title>Hello World</title> </head> <body> ...
How to Create a PHP Abstract Class

How to Create a PHP Abstract Class

PHP, Tutorials
An abstract class in PHP is special because it can not be instantiated. Instead, you typically inherit a set of base functionality from them in a new class. For that reason, they are commonly used as the base classes in a larger class hierarchy. To better demonstrate this concept, we will create an abstract Animal class and then a Dog class to inherit from the Animal class. In our project, we may very well decide that no one should be able to instantiate the Animal class, because it's too unspecific, but instead use a specific class inheriting from it. The Animal class will then serve as a base class for our own little collection of animals. Our Animal class with have some basic properties that describe its attributes like age, hunger, distance covered running, the types of food ...
How to Create SVG Images

How to Create SVG Images

HTML, Tutorials
SVG is an image format for vector graphics. It literally means Scalable Vector Graphics. In HTML5, you can embed SVG elements directly into your HTML pages as images and use them for cool effects such as animations. In this tutorial we are going to create a square image using SVG and animate it by sliding across the screen from the left to the far right on mouseover. As the square begins to scroll it has a blue background color but once it reaches the far right corner the background color changes to red. You can view a live demo of the finished sliding square project here. Feel free to download the code for this sliding svg square image project from github. In your project directory create three directories and the index.html file as shown below. css images js index.htm...