Username: 
Password: 
PHP Tutorials

Concepts / Scripting vs. Viewing

Subtitles of the Movie

In the last two movies, I mentioned the difference between client side and server side scripting. A good way to demonstrate this would be to attempt to directly load a PHP file into a web browser without using a server, piece of server software. All my PHP files are stored within this folder htdocs, this is the root of the web server that I'm using - Apache. Your document root may look a little different depending on what server software you're running but all your PHP files should be stored within the document root of your web server. We're going to have a look at enter.PHP, which is stored within the forum test folder and we're going to try and drag this directly onto our web browser. As we can see, the- all the script is echoed directly onto the browser. Obviously not the effect we're looking for, the reason for this is that the web browser Internet explorer has tried to load the file directly from it's location on drive c. However, if we replace this, part of the address with the address of our local host, which we can represent either by numeric value or simply by the word local host using forward slashes, something to remember if you're working on Windows as I'm, then we try to run the file. As we can see, the PHP has been interpreted by the server and this has been echoed to the browser. Now if we look at the source, and this is something that we can do if we're doing client side scripting such as Java script, we could look at the source and then we would be able to see exactly how this page was put together. However if we look at the source of this page, as we can see, none of the PHP remains, all we have here is the html made to create this page. So the PHP was read by the server when we made the request, processed and then the only thing that arrived at our browser was the html that was served by the PHP script. This is a very important difference that you need to grasp before you move on to start making your scripts. In our next movie, you're going to write your very first PHP script.

Tutorial Information

Course: PHP
Author: Joshua Mostafa
SKU: 33332
ISBN: 1889347787
Release Date: 2002-03-26
Duration: 9.5 hrs / 92 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 70,000 Video Tutorials (14,250 free)
  • Video Available as Flash or QuickTime
  • Over 650 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available