This is the 22nd day of my participation in the August More Text Challenge

☆☆☆ Today’s learning content: (server and client related)! Check the gaps! Do do do

Can serve as a beginner’s learning route, can refer to, learning progress is not particularly driven! Ongoing update

Combined with their own understanding, simple and comprehensive summary of the basic knowledge points in the process of learning JavaScript in vernacular Chinese, easy to deepen understanding!

Let’s get started! ‘Only a firm foundation can build a tall building ‘! Come on! Take it seriously!

1. Server and client

  • Client program: run directly through the browser
  • Server program: can run by installing some server software program
    • apachePHP file127.0.0.1
    • tomcatThe JSP file
    • iis. The asp file. Net

Server files must run HTTP and HTTPS under some protocol default port number 80

2. PHP syntax

Syntax specification:

  • 1. The statement must be followed by a semicolon
  • 2. Be case sensitive
  • 3. All punctuation marks are in English half-corners

Variable definition: must start with $

Three major structures:

  • The order
  • choose
  • cycle

Arrays: indexed arrays and associative arrays

3. How does the PHP server accept front-end data

$_GET[] Receives data requested by GET, path pass value: the address bar is not secure

$_POST[] Receives data requested through POST, which is secure

$_REQUEST[] can receive both GET and POST requests

Use name in the form to pass values (sending data to the server)

4, PHP to generate dynamic web page principle

The data is changeable (such as dynamic news). Generally, the data is taken from the server, and the server data is updated in the background, and the data of the page is updated (the front-end will not modify the data, the workload is too large).

5. How does PHP convert an array into JSON and send the data back to the client

Json_encode () converts PHP arrays into JSON objects (a normal array is an associative array)

Fixed usage: associative array to object

XSS attack

What is XSS:

Cross Site Scripting is called XSS to avoid confusion with cascading stylesheets

The user input some character data with specific meaning to submit to the server, these special characters can be recognized by the server

How to solve:

  1. Front-end regularization (does not completely solve XSS attacks: expert programmers copy HTML code to another page for attack effect)

  2. Best solution: backend validation (remove tags) Remove tags via the strip_tags() function


Preview: Come on, dream chasers

Learning is a continuous process, stick to it, there will be harvest!

It is not easy to adhere to it, it is not easy to adhere to it, accumulate over a long period of time, consolidate the foundation, early into Dachang!

Calm Down & Carry On!


Read more:

Review of previous updates

【 relearn JS】 Every day to strengthen the foundation of the series of articles:

【day1】

Day2 various operators, DAY3 data types, DAY4 loop structures & conditional statements, DAY5 functions (emphasis), day6 scopes & events,

【 DAY7 】 object & array method summary, 【day8】 string method & partial sorting,

【 DAY9 】Math object & Wrapper Function, 【 DAY10 】BOM- Browser object model,

【 DAY11 】DOM- Document Object Model

【 DAY13 】Event Event object first known (2),

【 DAY14 】 Event delegate & Drag principle

【 DAY15 】 Drag-and-drop implementation & regular introduction, 【 DAY16 】 regular specific method,

【 DAY17 】cookie, 【day18】ES6,

【 DAY19 】Js motion function encapsulation, 【 DAY21 】 the first three weeks of learning review

More on the way… A long way to go ==-.. – = =