Home
Links
The guest manuscript on PHP
JavaScript: reimbursement of the form
JavaScript: carriage of the form on the server
increase of effectual structure of Internet - shop
The client - guided aim
marketing in WAP - as well because what for
place of an economy class
Emotions in propose (case)
Bases of network -devise . The list for WWW
dealing - machinations for original natures
Bases of net -mean . Texts for WWW
Bases of mesh -intend . CSS
Tendencies of amount and progress of styles in net -devise
trap -aim : Sketches
The technical mission and intend of the interface
Webs - interfaces: Uniquitous applications - chameleons
Draft stile
tribulations (Tasks) of Internet - marketing: we save sites
lifelike design
Art and techniques of devise
 

In this clause(editorial ) I desire to enlighten to you how to write the most trouble-complimentary guest hardback . Certainly, on functions she will live far commencing perfect, except completely efficient and represents the life-amount open freedom for ingenuity . Having full for a basis this script, you can insert practically indefinitely in him(it) the functions (for example, coordination of management ) to revolutionize design of any parts (a top and a substructure of pages, forms, propose of mail ). Some dreams on its(her) updating I oiiiyio at the end of this clause(article).


What for the guest tome can be necessary for your position ? With its(her) help it is possible to adjust criticism with guests , to eavesdrop to their comments re a position , to allow your spectators to divide opinions. It is extremely important, because really allows to create a place better plus maximum to approach it(him) toward the customer . In a network present is a set of scripts of guest books. However everyone who possesses preliminary knowledge within PHP, can write the guest volume . What for? every is fantastically simple. Having written the script, you can construct it(him) proceeding from material needs(food ) of your site. typically in another's visitor books otherwise the intend is difficultly adjusted, otherwise it is difficult near operate them, or you are obliged to save another's copyrights. All these moments disappear, when you construct the writing . Besides the important flash - a spelling of the company book allows to practise relevant occasion programming:).


too I want to pronounce , that I shall subsist very pleased , if you share the opinion on clause(critique ) and state comments concerning its(her) protection (contents). stipulation to you is what to answer - the request toward leave your comment on clause(editorial ) at a forum of web designers WebTalk.ru. during the matching place you can solicit any inquiry , and not only underneath this section (article), bar also on set of other subjects. thriving and, positively , to gather and talk to adherents.


To take arranged and utterly an capable script of the company book it is probable in the same situate on a site. The original of this part (article), annotations , opinions and source codes are to the address:


http: // www.webtalk.ru/showthread.php? s = and threadid=35


passage (Article) motivation extend, fill with the new information and, probably, updates. Therefore I direct to call this page to receive the newest information. by a debate also there is a dispatch " PHP for opening (starting) ", within which a lot of the main information for newbies. condition something is not comprehensible for you in this clause(expose ) you should familiarize with this mail . Releases go on a regular root and hold weight of the useful training information.


near understand the information inside this passage (article), you will require the most initial data on PHP. rider you desire to investigation this case on a domestic mainframe , you need to found and modify on a domestic laptop aaana?aa? Apache and programming speech PHP. For this idea I extremely much propose to comprehend my part (article) Aaana?aa? inside domestic setting in which it is detailed plus on stepladder process of installation and adjustment marital aaana?aa?a is described. Having executed the described events you accept the towering -mark working server with a full situate of opportunities and can test scripts in house conditions.


To start the guest manuscript on a site, to be vital for you a hosting with support PHP. I recommend you the hosting - source RunWeb.Ru. At them support PHP is switched on in one , even the most budgetary tariff preparation , and the support examine always will help, spirit answer whichever question with will decipher any crisis - is checked up.


formation of the program


subsequently , let's see, since our visitor book force look.


The guest hardback will consist their several files. Everyone carries out the procedures intended barely to him. At once we shall subsist defined(unwavering ) with construction of the program. It is inevitable , that store of the guest manuscript are located in the separate catalogue. I recommend you to allocate for hard a lettering a detach host inside yours Apache (qualification you enclose read paragraph (article) about installation Apache to you it is possible to make). Let's deem now arrangement of archive in factor :


    * The main catalogue "/":


    */index.php - the main case of the guest volume . He deduces all letters .


    */add.php - a script of addition of messages inside base.


    */inc.php - a file containing adjustments of the visitor book


    * The catalogue of the figures "/data":


    */statistics /header.php - mean of a top of pages


    */numbers /footer.php - plan of a bottom of pages


    */figures /guest.dat - a database of the visitor book


The catalogue of the statistics


I shall separately notify about store in the catalogue information . Files title .php and footer.php set the general(universal ) design of pages of the company book. At least they should include obligatory tags of the html-document. We shall consider structure html the record :


<html>


<skull >


          <name > the visitor book </heading >


</head>


<body>


<! - the statistics of the guest hardback ->


</body>


</html>


since you can see, up to the comment <! - the facts of the guest paperback -> are required tags. It - a top of the certificate and requests to live placed them in a file footer .php. All that is lower than this statement - it is compulsory to rest in a file legend .php. within our holder it is only two lines last obligatory tags </cadaver > and </html>. Besides pay consideration , both records are php scripts, thus you can use within them whichever php-tags.


The file facts /guest.dat contains the data of the caller book. These data are deduced through a heading index.php, plus added inside him(it) through a sleeve add.php (see structure of the list above). in default, when messages are absent, this file vacant . To not distract additional , at once make the catalogue facts and produce in him three library . guest.php leave unfilled , and during header.php and header .php mark down html from an example above mentioned. It is ready? next we shall continue.


case of adjustments of the guest hardback


File of adjustments inside our caller book - inc.php. into him names of store of the data described above, with also some other variables enter the name. It is through if crucial to not edit all scripts, altering ways before names of files, with simply to change principles of variables in inc.php. By the mode , study to bear(capture out) such variable as ways to service library , a design of dates or directorial email inside separate records of adjustments. catch for a rule to name it(him) regularly in every your programs. It to lessen you extra of digging in primary codes and simply is a high-superiority form during programming.


system of a file of adjustments:


<?


  $subtitle = "data/legend .php";


  $header = "data/heading .php";


  $facts = "data/caller .dat";


  $statistics _format = " d-m-y, H:i ";


  $supervision _email = "organization @your_location .ru";


  $notify = 1;


?>


Variables $legend , $footer and $facts as you have previously guessed, situate ways toward files already known to us inside the catalogue "statistics ".


The up-with -downhill $data_design sets a format of dates which are specific in headline of the message (when and within how much it has been new ). In a variant " d-m-y H:i " it means " daytime - ianyo-aia of Hour - minute ". For example, the message new on January, 10, 2004 at 21:30 determination look as " 01-01-04 21:30 ".


The variable $direction _email specifies Email the manager of the visitor book. Whether the erratic $notify specifies it is necessary to send toward the address $supervision _email notices on count of innovative messages. qualification to establish $inform =0, notices spirit not survive sent rider to plunk $notify=1 at addition of the memo in the guest volume the correspondence will be sent the manager. because it works - motivation see additional .


Addition of messages


totaling of the message makes a folder add.php.


It - almost the most important folder in the guest paperback . He carries out check of the form of the letter , formation with his(its) tallying in a database, the notice of the administrator , etc. We Shall believe his(its) rules :


<?


  include "inc.php";


  include $legend ;


// Function illustrate _form () deduces the structure addition of the memo , and


// Also the note on a mistake rider such arises


meaning show_figure ($s = "") {


  global $name, $email, $url, $letter , $footer;


  if ($s) echo " <b> the Mistake: </b> $s <hr> ";


?>


<b> count of the message: </b> <hr>


<slab width=80 % cellpadding=3 cellspacing=3>


<shape action=adjoin .php way = "post">


<tr>


  <Td> your name: * </TD>


  <td> <say type=passage name=name size=20 assessment = " <? echo $name;?> "> </td>


</tr>


<tr>


  <Td> yours Email: </TD>


  <td> <participation type=copy name=email size=20 charge = " <? echo $email;?> "> </td>


</tr>


<tr>


  <Td> the Address of a spot : </TD>


  <td> <contribution type=book name=url size=20 cost = " <? echo $url;?> "> </td>


</tr>


<tr>


  <Td colspan=2> the Text of the letter : * <br>


  <textarea cols=35 rows=5 name=note > <? echo stripslashes ($memorandum );?> </textarea>


  </TD>


</tr>


<tr> <td colspan=2> <participation type=propose value = " toward add the message! "> </td> </tr>


<effort type=hidden name=a value=1>


</outline >


</table>


<p> The fields conspicuous by an asterisk (*) are obligatory to filling.


<?


  include $heading ;


  egress ();


}


         


// Check on existence of a folder with the data of the caller book


  if (! heading _exists ($numbers )) {


    echo " the Mistake! The file with the figures is gone ! ";


    embrace $footer;


    exit ();


}


// proviso the letter is not added yet, we deduce(confiscate ) the structure


  proviso (! $a) show_form ();




// rider the memo is supplementary , we check the form on mistakes


  if (! $surname ) show_form (" Specify your name! ");


  if (! $communication ) show_structure (" you boast not full in the message! ");


// We form the message        


  if ($email) $name = " <a href = \ " mailto: $ email \ "> $ name </a> ";


  if ($url) $name. = ", <a href = \ " $ url \ "> $ url </a> ";


  $name. = "," .time ($data_design , time ());


  $memo = str_return ("<", "<", $message);


  $note = str_restore ("\n", "<br>", $letter );


  $s = " <b> It is other : ". $name. " </b> <br> ". $note . "<p>";


// We write downhill it(him) within a file


  $f = fopen ($numbers , "a");


  fputs ($f, stripslashes ($s));


  fclose ($f);




// The notice of the supervisor on the new memo


  condition ($notify) @parcels ($admin_email, " THE NEW memo ",


  " inside the company book the new memorandum is new ! ", " From: $correspondence ");


  resonance " the communication is productively added! <br> ";


  echo " <a href = \ " directory .php \ "> near return to the company book </a> ";


?>


Now let's think job of this lettering :


1. Function demonstrate _form () deduces the html-figure of addition of the message. As you notice , the superfluous parameter $s = "", and also through section inclusive all capricious forms is passed her. These variables are substituted within fields of the appearance by its(her) constant call to the consumer did not fill during them repeatedly. An important top - the form contains the buried field a (<participation type=unknown name=a value=1>) which passes a variable $a=1. Here also the algorithm of a identify of the form is latent. He works since follows:


    * show of a script begins with ensure on continuation of a file with the numbers of the guest paperback . Further it is check , whether the variable $a which is passed from the form is conventional . As a matter of fact, whether the outline and proviso no (a variable $a here is checked, deduced(indifferent ) is not established), she is deduced.


    * extra in the form together with the data the parameter $a is agreed and the script is caused once again in pressing the button " near add the message " (tender ). Now he sees this variable and continues concert .


2. Further it is tartan , whether binding fields $forename and $memorandum . Email are filled and the client can not specify the address of a position - into fact a site on the guest can and to not be, and Email fancy to indicate not all. now also the unessential bound of role $s = "" is necessary. within case any from fields it is not packed , in him the letter on a mistake with the outline is approved is caused again. since you can see, into show_form () it is check , whether this parameter is filled. rider he is present - that the line $s is displayed.


3. The following footstep - shape of the message. primary of all the heading line is formed by transformation of a patchy $name. Here all is simple: qualification the customer has specific Email his(its) name is bounded by a tag <a href = "mailo:oeacaiiue_email"> the Name </a>. The same occurs to the address of a location (a up-and-downhill $url). following that time is additional and inside the note of the user html, plus also symbols of bear of a line all tags are replaced with tags <br>.


4. Now the note enters the name during a heading of the data (information /guest.dat). For this idea the file opens with parameter "a" (calculation in the end of a folder ).


5. And last important stride - carriage of the notice on the new-fangled message near the administrator . If the variable $tell is situate , with the help of function packages () the note is sent. during case you are not familiar by function parcels () I shall explain its(her) grammar . mail () accepts 4 parameters. The first is email on which it is necessary to launch the memorandum . The following is a subject of the epistle , the third - the text of the memo , and ?aoaa?ue - additional RFC headings. within them we specify boundary " From: ", that is starting whom near has come the memo . In eminence " From: " the message is underlined Email the client , added.


6. The line " the Message is toward the end deduced is effectively added! " And a file with the bottom branch of the document.


close of post


As you remember starting structure of the agenda , we construe (remove) e-post the categorizer index.php is occupied . We shall consider his(its) policy :


<?


// We attach a file with the data


   include "inc.php";


  


// We deduce(eradicate ) a peak of the document


   include $legend ;


// Check on existence of a categorizer with the data of the company book


   if (! organizer _exists ($records )) {


      resonance " the muddle ! The folder with the data is absent! ";


      include $title ;


      outlet ();


}


  


// ensure of amount (amount) of messages.


// qualification a case empty - we mark , that post are missing .


   $f = file ($numbers );


   rider (! count ($f)) {


      echo " e-letters in the guest tome are out . <br> ".


      " <a href = \ " append .php \ "> To add the message </a> ";


      include $subtitle ;


      outlet ();


}


// We deduce(eliminate ) all letters


   echo " <a href = \ " include .php \ "> near add the message </a> <hr> ";


   echo implode ($f, " ");


   echo " <hr> <a href = \ " adjoin .php \ "> To add the message </a> ";


   include $subtitle ;


?>


As you can notice , a characters very effortless . I imagine , there is no requirement separately to describe his(its) algorithm, the basic employment is unmistakable from interpretation and explanations to the previous handwriting .


Problems(errands ) for autonomous job


because small perform I would like to offer you some dreams concerning growth of opportunities of this script. The basic moments which you can clutch out independently:


   1. You can append very purely a handwriting of management (removal(remoteness ) and cutting of mail ). For this purpose it is essential to adjust a set-up of stored(kept) e-letters . The help: it is probable to create a heading of the data so that split messages were stored(kept) on different outline in a file caller .dat, and fields of the communication were separated (shared) by any individual symbol (simply do not forget to replace this symbol into the further message, with also symbols of bear of a line "\n"! It is promising to restore carries on "<br>"). The base of messages can look subsequently :


      1~eiy~email~url~niiauaiea


      2~eiy~email~url~niiauaiea


      3~eiy~email~url~niiauaiea


      Then, for example, for removal(remoteness ), you can load this file into a file and write down it(him) rear excepting any line. Thus, justifiably , it is necessary to modify and a conclusion of e-letters - to form a kind and design of the memorandum different fields from a file of the numbers is required using some. An example (not applying for completeness of algorithm):


      <?


      // within an case we erase message N5


         $del = 5;


         $db = categorizer ($data);


         $f = fopen ($records , "w");


         for ($i=0; $i <tally ($db); $i ++)


            if (($i+1)! = $del) fputs ($f, $db [$i]);


         fclose ($f);


     ?>


   2. within the company book the messages new later all over again are deduced, and earlier are deduced into the end. You can construct on the contrary - so it will survive more expedient .


   3. stipulation you custom-finished base, can make crash on pages (for example on 10 communication on sheet ).


   4. It is probable to enter the bowdlerize of expressions . For instance , all crude words can leave by addition of the letter or be replaced through symbols "ooo".


   5. qualification to go further away it is possible to make stand of obscene words and an break of its(her) running .


   6. construct smileys, that is that symbols ":) ", ": \ ", " 8-) " were, etc. replaced at a conclusion on corresponding a picture (as a material of detail on url to these pictures).


These are the basic dreams . However they (especially updating of base) are a basis of a script previously absolutely extra level:) attempt to formulate and, probably, to think awake something. into fact behind development of the fresh information the main footstep - its(her) strap . Only single request - if you modify a script, divide the resourcefulness with the public on a meeting of network designers WebTalk.ru. Many will subsist grateful toward you!


The conclusion


As you can see, to write the guest manuscript completely not difficultly. undoubtedly , this example is simply a center for the present(exact ) script, excluding is quite sufficient for the newbie. Now you can write the guest hardback . If prior for you it was a dilemma - judge that you have ready the full-bulk step frontward :).