Home
Home Page
PHP and Web. Caching
Job with Cookies on PHP
Electronic dispatches
JUzabiliti the main page
Natural keys against artificial keys
Uniform autentifikacija Windows NT/2000 and Oracle
The manual on Link Popularity
Partner Links: optimize an exchange of links
What for registration in catalogues through 1PS.RU is necessary
Krossbrauzernyj DHTML
DHTML-skriplet - it is simple about simple
Promotion of a site with the help of bulletin boards
The practical grant{manual} on a spelling of slogans for websites
We check the site - that has taken place with your ranging?
PHP: Patterns
Use of patterns in PHP4
Really easy change of design
Job with patterns, use HTML-Template with CGI-scripts
Job with files in PHP
Links
 

Really easy change of design

The prevention{warning}


The given text on anything does not apply. I hope, something from described will help you with development PHP and his  use in daily practice.


At once I shall make a reservation, that I not only understand programming in general, but also in PHP in particular a little. Accordingly and clause{article} was written for the same audience. The lamer to the lamer. Or to the layman - layman, somehow. The majority of the information can be found in forums or on English-speaking sites.

The brief summary


After perusal of clause{article} you can use only one file for entering into him  of changes of design and navigation. Contents of a site thus will not need even to be touched!

Easy change of design


So, at you already that that is. What that information web the project. A series of clauses{articles}, online the book, simply a page.

It is good, if at you that's all right with the project on a disk. Each section in the catalogue, scripts are organized and buzz, the design is fixed forever.

At me such was not.

That is the order that was, and with design - a full blockage. Plus I am constant that that I fasten, I play about with contents. What have I made?


It was necessary to me: easily and without serious consequences to change design, navigation, links and banners, to insert new sections and all this should pass with minimal telodvizhenijami.

I vovsju used SSI. You know what is it such? Roughly speaking, at me the pattern khtml was, I inserted into him  varying ehlemnty such as the menu of navigation, banners and so on. But the maintenance{contents} of this already filled pattern - did not vary! That is for each page in a pattern inserted the information, and saved on the server. After that to change color of the table, I should do{make} anew a pattern, to pull out the information from old and to insert in new. It is possible to use, certainly, CSS, frames, that there still. But all this for the different reasons did not satisfy me.


Still, as an output{exit}, use of the program which would replace in all files one lines with others seemed to me. That, sirs, that! If that that complex  in the plan khtml, moreover written manually, all this infernal work. Only do not think, that I wrote on khtml.

There were, certainly, some lines nakropaju, but I lazy. For me all did{made} FrontPage 98. Okhaivaemoe all a miracle.


What to do{make} with this heap of files with expansion *.shtml and impossibility to replace design so it would not respond painful{unhealthy} perelopachivaniem all this heap? I am lazy, and in the searches I have come across the best decision - PHP.

The opportunity which he gives - one khtml-pattern plus files only with contents was undressed by me have very quickly estimated!


Bystren`ko and monotonously having released{exempted} the shtml ki from different tablets, inserts, pictures, and another mutoteni I have wiped sweat from a forehead. Has cleaned{removed} expansions of files. The matter is that mine khoster at make{become} artfully - late night their script inserts into all files with expansion *.html a code of a banner.


It! A harmonous number{line} of files was built before my look. Washed, grown thin and cleaned they demanded new odezhki-design.

I svajal a new pattern: index.php3.

<HTML>

<HEAD>

</HEAD>

<BODY>

<? php

function foo ($in) {

<! - if not it is caused simply index.php3 that there is an insert of a caused file->

if ($in! = " ") {$out = $ in;}

<! - if there is a call index.php3 without a name of a file by default, the file main-> is inserted

else {$out = "main";} return $out;}?>


<! - my design and navigation->


<! - the Call of function with argument - a name of the file, the required user->

<? php include (foo ($QUERY_STRING));?>


<! - my design and navigation->


</BODY>

</HTML>



Now I cause pages so:


http://myserver.ru/index.php3?news

http://myserver.ru/index.php3?links

http://myserver.ru/index.php3?about


And it is possible and it is simple:


http://myserver.ru/?news

http://myserver.ru/?links

http://myserver.ru/?about


Absence of expansions is not the critical requirement. If at you a set of files with expansions, it will not serve as an obstacle. It is possible to cause for an insert any files in the catalogue of the unit.

For example:


http://myserver.ru/index.php3?news.shtml

http://myserver.ru/index.php3?links.txt

http://myserver.ru/index.php3?about.htm


Certainly, if it is necessary to make changes to contents (news to renew to add a new link) it is necessary to open files news and link and already there something to change.

Minuses of the approach


1) Tegi <meta> and <title> are distributed to all pages of the units incorporated by general{common} index.php3.

2) If the search engine incorrectly processes the sites using PHP the user can and not find your site.