Ravensky - PHP: Full Guide
Here you can read online Ravensky - PHP: Full Guide full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2016, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:
Romance novel
Science fiction
Adventure
Detective
Science
History
Home and family
Prose
Art
Politics
Computer
Non-fiction
Religion
Business
Children
Humor
Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.
- Book:PHP: Full Guide
- Author:
- Genre:
- Year:2016
- Rating:5 / 5
- Favourites:Add to favourites
- Your mark:
- 100
- 1
- 2
- 3
- 4
- 5
PHP: Full Guide: summary, description and annotation
We offer to read an annotation, description, summary or preface (depends on what the author of the book "PHP: Full Guide" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.
PHP: Full Guide — read online for free the complete book (whole text) full work
Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "PHP: Full Guide" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.
Font size:
Interval:
Bookmark:
Contents:
Part I. What is the web programming. Main technologies
Part 2. PHP: Hypertext preprocessor
Part 3. PHP installation
Part 4. Apache+PHP configuration
Part 5. PHP5 installation
Welcome to the world of web programming! During this course I will try to teach you, and you, in turn, will try to learn to create various Web applications, from elementary examples, to full-function products.
At once I will notice that I write, calculating that you know bases of a markup language of HTML and you have at least brief experience of programming. Otherwise... well you understood.
But, before to begin studying directly of the PHP language, let's understand that such web programming.
I. What is the web programming. Main technologies
I-1. Client-server
If you already tried (and can be, even it is not unsuccessful) to program, for example, on Delphi, either Visual Basic, or even the Visual C ++, then got used to such scheme of a program runtime: the button is clicked - the code is carried out - the result is displayed, and all this is carried out on one computer.
In web programming everything is in a different way.
You thought what occurs when you enter in an address bar of the URL browser (Universal Resource Location, or in a popular speech - the address)? Scheme of work following:
The browser opens connection with the server
The browser sends the server a request for obtaining the page
The server creates the answer (most often - a HTML code) to the browser and closes connection
The browser processes a HTML code and displays the page
Pay attention on highlighted in bold. Still before you saw the requested page on the screen, connection with the server is closed, and he forgot about you. And when you will enter another (or the same) the address, or click on the link, or you will press the HTML forms button - the same scheme will repeat again.
Such scheme of work call "client-server". The client in this case - the browser.
So, connection with the Web server lasts only several seconds (or a share of seconds) is a period between click on the link (or in a different way a request) and the beginning of page display. The majority of browsers during connection time display a certain indicator, for example, MS Internet Explorer displays animation in the upper right corner.
The attentive reader can notice here - and how so, I already read the page, and the indicator still shows connection process? The matter is that tag (loading of the image) and some other are no more than one more server request - and it is carried out just as also any other - according to the same scheme. And the picture request, from the point of view of the server, is completely independent of a HTML nickname request.
Forever to get rid of HTTP perception as "a black box", "we will pretend to be" the browser by means of telnet:
Let's start telnet www.php5.com 80
Let's enter in a terminal window the following (if input is not displayed - nothing terrible):
GET/HTTP/1.0 [we will click Enter here]
Host: www.php5.com [we will click Enter twice here]
Clicking of Enter corresponds, as a rule, to a combination of characters of CR + LF designated as \by r\n. This designation will be used further.
On the screen will run a http://www.php5.com/ page HTML code. As you can see - anything difficult.
The source code of the current page can be browsed practically in any browser, having selected in the View|Source menu.
Pictures, frames - all this additional requests, just the same. Actually, from where pictures in a browser window undertake: when parsing (processing) of a HTML code, the browser, stumble on a tag makes additional server request - a picture request, and displays it on site where there is a tag .
Try:
telnet www.php5.com 80
GETphp/php5com.png HTTP/1.0\r\n
Host: www.php5.com\r\n\r\n
On the screen will run what you will see if you browse this png-file in a text editor.
I-2. HTML forms. Methods of sending data for the server
You for certain already met HTML forms:
Enter your name:
Having saved this code in the HTML file and having browsed it by means of your favourite browser, you will see a usual HTML form:
Beginning of a form
Enter your name:
End of a form
Let's consider the tags used in this small example in more detail.
The tag
having pair ending tag , actually also sets a form. Its attributes - both are optional:action - specifies URL (full or relative) to which the form will be sent. Sending a form is the same server request, as well as all others (as I already described above).
If not to specify this attribute, the majority of browsers (more precisely, all browsers known to me) send a form to the current document, that is "to themselves". This convenient reduction, but according to the action HTML attribute standard it is obligatory.
method - a way of sending a form. They are two.
o GET - sending this form in an address bar.
You could notice presence at the end of URL of the character on the different websites "?" and the following data behind it in a format parameter = value. Here "parameter" corresponds to value of name attribute of elements of a form (see below about a tag ), and "value" - to value attribute contents (it, for example, contains input of the user in a text box of the same tag ).
For an example - try to look for something in Google and pay attention to an address bar of the browser. It is also the way GET.
o POST - these forms go in a request body. If it is not absolutely clear (or it is absolutely unclear) what is it - do not worry, we will return to this question soon.
If the method attribute is not specified - "GET" is meant.
The tag - sets the form element determined by type attribute:
text Value sets an input single-line text box
submit Value sets the button when which clicking there is a sending a form for the server
Also other values are possible (and - not the only tag setting a form element), but we will consider them in the following chapters.
So, what occurs when we click OK?
The browser browses the elements incoming a form and creates these forms of their name and value attributes. The name Bryan is Let's say entered. In this case these forms - name=Bryan&okbutton=OK
The browser establishes connection with the server, sends a request of the document specified in action attribute of a tag
for the server, using the method of sending data specified in method attribute (in this case - GET), transferring these forms in a request.The server analyzes the received request, creates the answer, sends it to the browser and closes connection
The browser displays the document received from the server
Sending the same request manually (with the help of telnet) looks as follows (we will assume that domain name of the website - www.example.com):
telnet www.example.com 80
GET /cgi-bin/form_handler.cgi?name=Bryan&okbutton=OK HTTP/1.0\r\n
Host: www.example.com\r\n
\r\n
As you, most likely, already guessed, clicking of the submit-button in shape with method of sending "GET" is similar to input of the relevant URL (a signed question and data of a form at the end) in an address bar of the browser: http://www.example.com/cgi-bin/form_handler.cgi?name=Bryan&okbutton=OK
Actually, the GET method is used always when you request any document from the server, having just entered its URL, or having clicked on the link. When using
, the question mark and these forms are just added to URL.Perhaps, all these technical details and exercises from telnet-ohms seem to you incredibly boring and even unnecessary ("and at what here PHP?"). And in vain. These are the basics under the HTTP protocol which each Web programmer needs to know by heart, and it is not theoretical knowledge - all this is useful in practice.
Next pageFont size:
Interval:
Bookmark:
Similar books «PHP: Full Guide»
Look at similar books to PHP: Full Guide. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.
Discussion, reviews of the book PHP: Full Guide and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.