Please check back in a few days
Want to make interactive web sites? Want to learn one of the most powerful, but easy to learn scripting languages around? Learn PHP, the language behind millions of websites world wide. Unlike javascript, which has to run on the viewer's computer, all of the work in PHP happens on the web side. Your pages will work the same no matter what type of computer your viewer is using. They don't have to install anything special like to see Flash, nor do they turn it off to protect their personal computer.
PHP is used for everything from customizing pages to meet your viewers preferences, to running blogs and shopping carts, to powering image galleries, to completing calculations to more! In this introductory class you will learn some of the most common tasks in which PHP excels like formatting data, handling forms, sending email and more. Since PHP and MySQL make such great partners throughout the world wide web, we will introduce you to some of the basics on the php side of that relationship. You will also get to work with a database that we provide you. Since this is an introductory course, we will focus on basic functions and how to incorporate readily available complex functions into your code. Throughout the course, we will be presenting best practices for coding to help you develop great programming habits.
You will be required to have a hosting account that supports PHP web pages. Check with your web hosting company to ensure that they are running PHP version 4 or 5. If you do not have a web host with PHP, check out the hosting accounts here at LVS Online.
All lessons are available in PDF format. Adobe Acrobat Reader is required to view/print the lessons.
Plan to devote 3 - 4 hours per week on the lesson and assignment.
Class Level - This is an introductory course which assumes prior HTML/XHTML knowledge. In order to be successful in this class, you must have a good working knowledge of HTML, especially forms, and know some basic CSS (background and text colors/sizes). If you don't have HTML knowledge, enroll in the Build Your Website Level I class first.
You need to be comfortable with FTP and uploading and downloading files to your web account.
We will be programming in PHP to have our pages carry out calculations. You will need to have a basic understanding of Algebraic equations like the following:
x = 5 y > 7 x + 2 = 5
... PHP Syntax
Since php is a scripting language, it can easily be used with in an html page. On the pages that we create in this class, many of our files will contain both html tags and php scripts. This is also referred to as an embedded language. Most times, you will be embedding php scripts with pages that also have html. No matter what the other code or language on your web page, if you want to run the php scripts you MUST save your file with the php extension like mypage.php. Some web servers will instruct you to use a slightly different extension like .php3 for your php pages. You must use the proper php extension for your web host or the page contents will never be sent to the preprocessor.
Our very first file will be a very simple php script. We will be covering PHP versions 4 & 5 in this class so you will want to know which version is running on your webhost. A basic one line script will tell us which version your webhost is running and introduce you to some important elements in php syntax.
Like html, php scripts have opening and closing tags. These tags alert the server that the code contained must be sent to the PHP hypertext processor before being sent to the browser. There are three different versions of php tag:
The standard tag is recommended for beginners as it is quick and easy to type but still gives a visual reminder that you are in php territory now. All of your php code must be contained with in php tags, otherwise it will be run as html.
echo phpversion(); ?>
The next word, echo, is a command. Echo is a command that tells PHP to print to screen. When you want PHP to display something on the screen of a browser you will want to use the echo command. There is a second PHP command to print to screen, print. You might see this in PHP books that you pick up or scripts that you borrow. It can be confusing to ponder why PHP uses two commands that look like they do the same thing. In actuality, print works more like a function and returns a boolean value. It is another example of the murky distinction of scripting vs programming languages. If you don't know what a boolean value is, you don't have to mess with a print command! What you want to know is that echo is faster and echo is what we will be using in this course. This is just one example of how PHP can be used by the beginner for basic web functions and still possess the capabilities required for more complex and comprehensive programming tasks for the experts.
After the echo command, you see a standard built-in PHP function. In this class, we will be using either one of the 3000 standard PHP functions or we will be incorporating premade third party functions into our code. Since this is an introductory course, we will not be writing our own functions in this class. Instead, we will learn how to efficiently use some of the great built-in functions that give PHP its power and versatility. As in most languages, PHP designates its functions with parantheses. Sometimes we will need to put information called arguments into those parantheses but this time we will leave it empty. There are no parameters for this function, it does not additional information to carry out its function. Most functions return a value and phpversion() is no exception. It return the version number of PHP running on your web server. ..
Please note: Lessons provide step-by-step instructions with detailed screen captures.
Content Copyright © 2009 LVS Associates Powered by osCommerce