PHP job book series-PHPWeb programming, job book web_PHP tutorial

Source: Internet
Author: User
PHP job book series-PHPWeb programming, job Book web. PHP job book series-PHPWeb programming, job book webPHPWeb programming form 1. what is the maximum transfer capacity of POST and GET? Form data submitted by the GET method: PHP job book series-PHP Web programming, job Book web

PHP Web programming

  Form

1. what is the maximum transfer capacity of POST and GET?

  • The form data submitted by the GET method is appended to the URL and sent to the server as part of the URL.The URL length must be less than 1 MB..
  • The POST method does not depend on the URL and does not display the passed parameter values in the address bar. In addition,The POST method can transmit data to the server without any restrictions.All submitted information is transmitted in the background, which is invisible to the user on the browser side and highly secure.

 2. how to control the size of the uploaded file through form?

  • Enctype = "multipart/form-data", which specifies the form encoding method.
  • Method = "post", specifies the data transmission mode.
  • , Control the size of the uploaded file by hiding the domain(In bytes). The value cannot exceed the value set by the upload_max_filesize option in the php. ini configuration file.

  3. how to set the read-only attribute in the form?

  • ExploitationReadonlySets the read-only attribute of the specified content;
  • ExploitationDisabledSets the read-only attribute of the specified content.

 4. under what circumstances can $ name and $ _ POST ['name'] be used universally?

  When register_globals is On in the php. ini file,Both $ name and $ _ POST ['name'] can obtain the value of the form element name in the form (submitted in post mode ).

However, it is not recommended to enable all register_globals variables because it brings security risks to the program.

  CSS style

1. what does CSS mean?

  CSS (Cascading Style Sheet, translated"Stacked style sheets"Or" Cascading Style Sheet ") is a markup language that can be directly interpreted and executed by a browser (a browser interpreted language) to control the appearance of a web page. It is a set of extended style standards specified by W3C to make up for insufficient HTML display attribute settings.

Its functions are as follows:

  • In the standard webpage design, CSS is responsible for the performance of the webpage content (XHTML.
  • A cssfile can also be said to be a development file, which contains some CSS tags. the CSS file suffix uses .css as the suffix.
  • The separation of content and forms through CSS files can change the overall form of the webpage, making it easier to maintain the site appearance, making the HTML document code more concise, and shortening the loading time of the browser.

2. how many CSS styles can be inserted into an HTML page?

  • On the HTML pageMark to define a pairMarkInside the tag, you can use the tag name, class identifier, and id identifier to set attributes.
  • Define the style attribute inside the tagAnd then define the style under the label, such:

  Create a. css style fileIn the file, use the id or class separator to define the style, and then on the displayed HTNL homepageExploitation Label import file. For example:

  

3. common attributes of CSS styles:

Common attributes of CSS styles
Attribute name Analysis
Border You can define border attributes to set border width, color, and style.
Background-color Set Background color
Background-image Set Background image
Font-size Set font size
Font-family Set font
Text-decoration Retrieves or sets the decoration of text in an object, such as underline and blinking.
Line-height Retrieves or sets the row height of an object, that is, the distance between the bottom of the font and the top of the font.
Letter-spacing Retrieves or sets the interval between texts in an object.
Text-align Sets or retrieves the text alignment of an object.

  

  

  4. how to solve the double margin problem of the following code under IE6?

 

This is a common Bug in IE6. Although the defined margin is 10px, IE is parsed to 20px.

Solution:Add property display: inline

  5. how can I solve the problem that the hover style does not appear after the hyperlink is clicked?

  Sort the hyperlink style attributes correctly.

  A: link {color: red; text-docoration: none}

  A: visited {color: blue; text-decoration: none}

  A: hover {color: black; text-decoration: overline}

  A: action {color: black; text-decoration: overline}

6. how can I solve the problem that text in Firefox cannot open containers?

Add two CSS attributes,Min-widthAndMin-heightYou can also add a clear alignment class clear: both attribute p to automatically calculate the height of Firefox.

  7. how to define a container with a height of around 1 px?

In the process of webpage layout, a partition is usually required between the navigation bar and the content Bar. Generally, the height of one pixel is the best.

 DIV tag

 1. labels and

Differences:

  

They are also applied to web page layout, but they differ in the following aspects:

  • The span tag is inline and is generally used for inline styles of small modules into HTML documents.
  • The p element itself is a block-level element and is mostly used to combine large pieces of code.

  2. how to center a DIV layer?

  Position: absolute;

  Top: 50%;

 Left: 50%;

 Margin:-100px 0 0-100px;

  3. how can the nested p tag text-align attribute in the filefox browser be invalidated?

1 5 

6

7

  JavaScript script

  1. functions in the pop-up dialog box and input focus functions:

Dialog boxAlert ()Function

Get input focus usageFocus ()Function

  2. what are the conversion functions of JavaScript? How to introduce an external JavaScript file?

Steering function:Window. location. href = "file name ";

Introduce external JavaScript files:5Automatic selection of Chinese zodiac678910112223 View Code

PHP script for judging the zodiac in the background:

1 $ Value) {5 if (ceil ($ _ GET [number] % 12) ==$ key) {6 echo $ value; 7} 8} 9}

JQuery framework

Currently, jQuery is a popular client scripting framework created by John Resig, an excellent JavaScript framework. its purpose is to write less and do more. it is a lightweight js Library, compatible with CSS3, and compatible with various browsers (IE 6.0 + ). Users can easily process HTML document and events, achieve animation effects, and provide AJAX interaction for websites. Another major advantage of jQuery is its comprehensive documentation and detailed descriptions of various applications. There are also many mature plug-ins to choose from. JQuery can ensure the separation of code and HTML content for your HTML pages. that is to say, you don't need to insert a bunch of JavaScript code into the HTML to call the command. you just need to define the id.

  1. commonly used selectors in jQuery:

  Basic selector:

Id selector: can be used only once

Class selector: allows repeated use

Tag selector

*: Matches all elements.

  Level selector:

$ ("# A. B") select all elements whose class value is B in the element whose id value is.

$ ("# A>. B") select the child element whose class value is B after the element whose id value is.

$ ("# A +. B") select an element whose id is a and the next class value is B.

  Filter selector:

: First, select the first element.

: Odd. select an element with an odd index.

: Even. select the element whose index is an even number.

: Not. select other elements except an element.

: Eq (), search for elements by index.

: Lt (), an element smaller than a certain index value.

: Gt, an element greater than an index value.

  2. how to find the elements in the DOM tree?

  Var input = $ ("input: first ");

 3. how to create and insert elements in the DOM tree?

1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.