worlditsme
New Member
There are many programming languages that can be used to create dynamic websites, one of the easiest ones being PHP, which is what this article will focus on.
PHP is simple to learn because it closely resembles the English language in terms of most of the programming commands that are available within it.
Here is an example script of a page written in the PHP programming language:
<?php
print("Hello World");
?>
The first and third lines of this script are standard within all PHP scripts, these lines being the opening and closing statements of the program, respectively.
The second line is the program itself, which in this example, is a simple print command which, as the name suggests, prints a message that is displayed on screen when the program is run.
One of the most basic things you will need to know in order to start using PHP is how to read data and use it within a program.
The easiest way to get outside variables into a PHP program is to use the following lines of code:
import_request_variables('p','p_'); - This allows POST variables (e.g. when submitting an HTML form)
import_request_variables('g','g_'); - This allows GET variables (e.g. when passing variables to a script directly)
Once you have this part of the program written, there are many other commands that you will need to know in order to start using PHP to its full potential.
The most common of these is the programming commands used to interact with MYSQL databases, as these are one of the most common ones in use on the Internet, which is most likely due to the fact that MYSQL is both open source and free of charge to all users for all purposes.
Some of the MYSQL commands are as follows:
mysql_connect(hostname, username, password); - Opens a connection to a MYSQL Database
mysql_query("THE QUERY YOU WISH TO RUN"); - Runs a MYSQL query.
mysql_close() - Closes a connection to a MYSQL database.
Although this is only intended as a beginners guide, there are many resources located throughout the Internet which go into more detail regarding some of the more advanced coding that is sometimes used when programming in PHP.
Overall, I would say that this is definitely the best programming language out there both in terms of usage and more importantly one of the easiest to actually learn.
PHP is simple to learn because it closely resembles the English language in terms of most of the programming commands that are available within it.
Here is an example script of a page written in the PHP programming language:
<?php
print("Hello World");
?>
The first and third lines of this script are standard within all PHP scripts, these lines being the opening and closing statements of the program, respectively.
The second line is the program itself, which in this example, is a simple print command which, as the name suggests, prints a message that is displayed on screen when the program is run.
One of the most basic things you will need to know in order to start using PHP is how to read data and use it within a program.
The easiest way to get outside variables into a PHP program is to use the following lines of code:
import_request_variables('p','p_'); - This allows POST variables (e.g. when submitting an HTML form)
import_request_variables('g','g_'); - This allows GET variables (e.g. when passing variables to a script directly)
Once you have this part of the program written, there are many other commands that you will need to know in order to start using PHP to its full potential.
The most common of these is the programming commands used to interact with MYSQL databases, as these are one of the most common ones in use on the Internet, which is most likely due to the fact that MYSQL is both open source and free of charge to all users for all purposes.
Some of the MYSQL commands are as follows:
mysql_connect(hostname, username, password); - Opens a connection to a MYSQL Database
mysql_query("THE QUERY YOU WISH TO RUN"); - Runs a MYSQL query.
mysql_close() - Closes a connection to a MYSQL database.
Although this is only intended as a beginners guide, there are many resources located throughout the Internet which go into more detail regarding some of the more advanced coding that is sometimes used when programming in PHP.
Overall, I would say that this is definitely the best programming language out there both in terms of usage and more importantly one of the easiest to actually learn.