Learn PHP
Site Map
Php Functions
C++ - Starting Out
Web Design Tools
Photoshop Tutorials
Droid Phones
Building Websites
ArrowTech Blog
Web Servers
Making Money
Favorite Links
Privacy Policy

Category: php


Explanation of PHP Basic Syntax --New to PHP

Php is a language that is very much like writing c. The best feature of PHP versus c is that it is designed primarily to be used on WebPages -- allowing the author to intermingle their php code and the HTML on the same page. Being able to mix these two languages together provides a very flexible environment that allows the author to code some very nice dynamic content. PHP is called a server side scripting language. Unlike a computer language such as C++, Visual Basic, Java and others, php does not require the programmer to have a traditional compiler. Instead PHP interprets the code and sends it back to the web server. This is sometimes referred to as JIT -- just in time compiling.

The Webserver in turn serves up a webpage that is formatted according to the instructions found in a php script and sends it to the client that requested it (usually a web browser running on a home pc or laptop). Using a language like php for web scripting makes it possible for a web designer to create a single page that can return completely different content every time a user leaves and then returns.

This is usually accomplished by embedding variables into hyperlinks or by using input text boxes. When the user clicks on the embedded links, the variables coded into those links is sent out to the webserver. You have probably noticed that when you click some links and look up in your web browser - there is this a long string of characters that looks something like this like this:


Notice the question mark right there after "index.php." the question mark tells the server to start looking for variables to parse (or interpret). Next, in the example link above, there is the "page" variable with an equals sign between it and "php_passing_variables." When this link is clicked the php script that the thenlinks points to loads into the user's web browser retrieving the "page" variable which is stored in a global variable array called $_GET.

The "page" variable looks like this $_GET['page']; to the programmer. This is called the GET method.

There are several other mtypes of varibles that you will become aquainted with as you learn php web programming.

Now, lets go over some basic php syntax. The first thing to cover is how to jump into and out of php code from within your webpages HTML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<title>Page Title Goes Here</title>

echo "You will see this when you run the script";


<h2>Then you can just add html where you want it</h2>


echo "now you can go back into php if you want to.";



Notice from the example above that you must start all of your PHP code with

and it is ended with


These two tags let the webserver running PHP know what parts of a web page are php code. Also notice that at the end of the echo statements, there is a semicolon. Semicolons in php tell the compiler when a line of code has been read and another line is about to start. Each simicolone signifies the end of a line of code.

The semicolon can be included on the same line but php will still treat it as the end of a line.

The next section will cover php code blocks and variable data types.

Author: D.Shaun Morgan

convert timestamp to readable date time using php Convert Unix Timestamp to Readable Date Time PHP User Function string function convert_timestamp(string $file_in

creating image watermarks Creating PHP Watermarks $my_image = imagecreatefromjpeg('photo.jpeg'); $watermark = imagecreatetruecolor(100

need to print out an array using php How toPrint PHP Arrays Things to Consider Are: Array Type- Single Array or Multidimensional Array


odd number php script Testing for Odd/Even Numbers - PHP Example Banner Rotation PHP Script Odd/Even Numbers The easiest way to setup an Odd / Even test using PHP i

how to upload images and files using php Upload Images to Webserver HTML Form PHP Function # UPLOAD FILE function upload_file(){ echo '

using php cookies variables Using Cookie Variables in PHP Setting cookies in php is pretty straight forward. There is a php function: setcookie(); This function mu

how to unzip files on your free hosting account Uzipping Files on Your Web Server If you are using a free hosting account with godaddy.com and many of the other Free hosts out there, you may have found that they don't offer you a lot o

passing data from one form to another form using php Passing data from one form to another form To pass php data from a form and then catch that data into another form one way to accomplish this task is to intermi

Just In Time Compiling JIT - Just in Time Compilers JIT refers to a special software that is found in web-browsers, and scripting engines such PHP's Zend. (My understanding of ZEND is that it

Storing image locations mysql Store Image URL in Database Retrieve Image with PHP Script

how to turn variable value into variable name Variable Variables in PHP Every so often when you are writing a php file, we all run into a situation where we would like for the name of the string that is inside

what-is-php Explanation of PHP Basic Syntax --New to PHP Php is a language that is very much like writing c. The best feature of PHP versus c is that it is designed pri

how to use dreamweaver Dreamweaver - WISIWIG Dreamweaver is a tool that arguably could be called the industry standard for web design . Dreamweaver, is an Adobe product that originally b

Filezilla Filezilla Ftp Client, FTP SERVER vs Wsftp By: D.Shaun Morgan While I was writing this article, about halfway through, I realized that it would be unfair to tell my readers about

notepad plus Notepad++ Download Notepad Plus Plus Notepad plus plus is an open source, free text editor. It is

how to open create write files using php Php file functions, Opening a file in php, reading a file in php, writing a file in php In this tutorial we will look at the most commonly used file functions used in php. The

stop form spam captcha PHP -- How to Protect My Email Form / Contact Form Against Spam Bots Author: D.Shaun Morgan Versions and Skill Level PHP 5

retreive images mysql using php How to get images out of mysql database with php and use them on my webpages Author: D.Shaun Morgan PHP Version - PHP 5x

how to make money online Making Money on the Internet Sign up for this series of free money making articles Name:

store images mysql using php Storing Images in Mysql Database Tutorial Outline: Creating a Test Mysql Database Example php Database Functio

php example post array Visual example of how PHP handles the super-global array variable "$_POST" Author: D.Shaun Morgan Versions and Skill Level

php arrays Passing PHP Arrays How to pass php variable arrays between pages. Author:

how to write php functions Explanation of a Basic PHP Function What is a PHP function? In PHP a function represents a block of instructions that perform

how to write html form using php When learning PHP to build a website, one of the very first things that any newcomer, or beginner needs to learn is how to use HTML or XHTML (both will mean the same for this tutorial.) fo

register globals long arrays Security, php.ini, register_globals and register_long_arrays Author: D.Shaun Morgan Versions and Skill Level PHP Version - PHP 5x

how to install php 5 How to Install PHP 5.x.x.x on Windows This is beginner's how-to manual explaining how to quickly setup a PHP 5 installation on a Windows PC. You must have an Apache webserver installed

php passing variables Pass Variables from One Page to Another -- PHP Author: D.Shaun Morgan Tutorial Outline : Passing PHP variables with $_


Leave a Comment


Name:      | Email:      | Website:



Enter The Above Security Code: