Personal Home Page This is a Hypertext processor It works on the server side It demands a Web-server to be installed
What is a Web-server? A program hat helps to deliver content that can be accessed through the Internet. It use a protocol to deliver the data.Internet It has a load limit – up to 1000 per one IP and totally up to 80.000 concurrent connections
The overloaded server can: Deny the access and return an error Allow unauthorized access Typical server-side http Errors: 500 – internal server error (many possible reasons) 502 – bad gateway (can’t connected to the specific address) 503 – service is not available 504 – gateway timeout
Typical Client-side Errors 400 – bad request (syntax error in the request) 403 – forbidden 404 – not found (accessing non-existing page) 444 – no response
World leaders Apache – free software developed by an open commuunity IIS – Microsoft, a part of Windows – Server XX OS
GET and POST HTTP methods Both the method submit a form to the server GET – is the default method POST allows encoding data GET" is basically for just getting (retrieving) data whereas "POST" may involve anything, like storing or updating data, or ordering a product, or sending E-mail
How it works "get" - -, the user agent takes the value of action, appends a ? to it, then appends the form data set, encoded using the application/x-www-form- urlencoded content type. form data are restricted to ASCII codes. "post" --, the user agent conducts an HTTP post transaction using the value of the action attribute and a message created according to the content type specified by the enctype attribute.
Files int fopen(string filename, string mode); Value Description a - appending only. r Open a file for reading only. w Open a file for writing only. They also use a+, r+ w+ $file=fopen(“mydata.txt", “r") $text = fread($file, 10); int fclose(int fp); fclose($file);
Assignments add two numbers on the client side with php The same but on the server side Save input to a file Input data to a text area, sort and save to a file Input a text in textarea and save it to a file but one symbol per line.
Assignment 4 Modify index.htm automatically. Every 2 minutes generate a text string and place it to the body of index.htm Use different categories.