GO-SCARECROW.NET *        & cut it up
WWW.GO-SCARECROW.NET / HOSTING
soleil / hails & lexi / priya / apply?
visitor tutorials site search clear
affiliates mauricio, kathy, loz, ann, amanda, angelica, misty, ryan, nathan, hapi, shannon, carter, amanda, elysia, lizzy, dani/karma, rae, maggie/stormi, jenna, inkedd, ellie, ariel, nina, zoe, sarah, dirk
eXTReMe Tracker

apply?

intro to PHP! go-scarecrow.

a note: to even begin to use PHP, you should first have a pretty good grasp on the basics of HTML an CSS.

what PHP is
PHP is a tool for website developing that allows you to use 'shortcuts' to different pages in your codes to create cleaner and more efficent codes. if you ever read the iframe tutorial, what php is is a more sophisticated and 'cleaner' iframe.

why use PHP?
say in your site that you have a section, like a sidebar or a links section that's updated frequently. many beginning site owners go through EVERY page on their site and copy and paste the change in, which is an absolute hassle.
with PHP, you save a file called, for instance, sidebar.php with the entirety of your sidebar code on it, then paste it on every page of your site. what PHP does is make a 'link' to the page (sidebar.php) that tells it to include whatever is on that file in the exact spot it is on the page.

using PHP in your site
maybe one of the hardest parts of using PHP is converting your entire site to it. for PHP to show up in any code, you have to change the extensions of all your files to .php (index.html or index.htm becomes index.php). this tells the computer to read all PHP tags.
after you've done this, create the file that you want to use PHP with. let's use a sidebar for an example. take all of your sidebar code and paste it into a new file called 'sidebar.php' (make sure to include the div that it's inside).

delete all the existing sidebar code on your newly renamed pages and replace it with that code. change PATH/TO/SIDEBAR.PHP to the url of your sidebar (for example, mine is "http://go-scarecrow.net/sidebar.php").
when you reload the page, the sidebar should show up just like normal. now, when you want to make changes to it (add affiliates, etc), all you have to do is edit sidebar.php.

additional uses
besides using PHP to include sidebars, you can also make a header.php (page titles, extra links, etc) and include it just like your sidebar.

suggested tutorials: iframes, linking stylesheets
modernism is pase.