PLEASE RELOAD
Introduction


All Scripts were written using PHP 5.04
on the Tandem Tables Server



These pages are not intended to teach PHP, but to show you some simple ways you can use php in your webpage design without learning it. Be sure your server allows PHP scripting or these scripts will not work. Servers info.

PHP is used right in your html pages. Any page...I repeat..ANY PAGE that has a PHP script must be named with a php extension.

PHP always starts with <? and ends with ?> They are little packages that can be placed anywhere. Punctuation is very important so pay close attention when you CCP. HTML used in PHP follows the same syntax rules as always.




Let's look at one way to use php. Let's say I was writing an article about stalagmites and I was going to use the word a bunch of times. It would be easier if I didn't have to type it all out every time. So let's do a PHP script.

<?

$S="Stalagmites";

echo "It is very difficult for people to remember if $S are the ones going up or the ones going down. $S are the ones going up. $S are formed by the dripping from above. The drips contain deposits that harden layer after layer. $S may take thousands of years to form.";

?>

Here's how it looks on a webpage:

It is very difficult for people to remember if Stalagmites are the ones going up or the ones going down. Stalagmites are the ones going up. Stalagmites are formed by the dripping from above. The drips contain deposits that harden layer after layer. Stalagmites may take thousands of years to form.

$S is called a variable and is the backbone of PHP. The S becomes the codename for the word. The $ says "Hey server codename here!!!"

Each script can have multitudes of variables named whatever you want to name them. Preferably something easy to remember and short. And these variable names can stand for anything; words, gifs, jpgs, bmps, html, letters, numbers, math operations, height, width, yadda, yadda, yadda...




Pitfalls do happen. One of these is called "white space"...it's an imposter, it's not really a space at all. To rid your script of this imposter...Hold the alt key and hit the space bar for your search, and replace with nothing.

You also must view these scripts after saving as you edit. They will not show in preview. If you have a "save and view", that's perfect.

Like with javascript, if your page comes up but your script is not showing; there is a punctuation error. If the page does not come up but "whizzes" out, you have a script error. Always save the original.




Sourcing & Sharing PHP scripts is not the same as regular html. If you source a PHP page you will not see any PHP, you will only see the html written by the PHP. You can CCP scripts with no problem as long as you check for "white space". For transloading, a zip file is best; but making a txt copy also works well.




Back SiteMap