|
|
PHP Tutorial
Introduction: Many peoples think that making a PHP layout is very complicated (probably because of the long URL) and that only experts should handle with it. I even used to think that. But it's the total opposite. Don't be intimidated by the long URLs with ? and = and other signs, making a PHP layout is just as easy as SSI.
What you need: But before you get started, make sure that your host accepts PHP. Usually, sign-up hosts don't accepting PHP, but I may be wrong since I don't know every sign-up host out there. To work PHP, you must know HTML and FTP. If you don't know one of the 2 languages, I suggest you do since they are both very useful for making websites.
First part: Ok, make your layout like you usually would. Once it's completed, take the content part of your layout and copy and paste it into a blank document. Then erase the content in your layout page. So you should have 2 documents, one with your layout "shell", where your left nav bar (if you have one), right nav bar (if you have one), top image (if you have one) and everything except your content would be and another document where only the text from your content would be. Now save the layout "shell" as the filenameofyourchoice.php, but we'll use main.php for this tutorial. Save your content as what the content was talking about, like if the content was from an affiliation page, save it as affiliation.html.
Second part: Now go to main.php and put <*?php include ("$done"); ?*> (remove the *) where the content would have been. You can change the "done" part to whatever you want, but I think done looks good. Then log into your FTP program and upload main.php and affiliation.html. Then go to http://yourdomain.com/main.php?done=affiliation.html and it should work! Now you can change your layout with ease! No more spending hours converting pages!
Newspro: For you newspro users, here's how you get newspro to work with your PHP layout. Instead of making newspro a SSI, put: <*? include("path to get to newspro from your site"); ?*> (remove *) What I mean by path to get to newspro from your site is that, like if you put newspro in your CGI-bin, make the path cgi-bin/newspro/news.txt. Make sure there isn't a slash before the first word in the path.
INSTANT TRANSMISSION
|