PHP Job Search Series--php Web programming chapter, Job search web_php Tutorial

Source: Internet
Author: User
Tags set background

PHP Job Search Series--php Web programming chapter, Job Search web


  PHP Web Programming Chapter

  Form form

1. What is the maximum capacity of the POST and GET transfers, respectively?

    • The form data submitted by the GET method is appended to the URL and sent to the server side as part of the URL. The length of the URL should be limited to 1MB characters .
    • The POST method does not depend on the URL, and the passed parameter values are not displayed in the Address bar. In addition, thePOST method can not have any restrictions on the delivery of data to the server , all submitted information in the background transmission, the user in the browser is not visible, high security.

  2. How can I control the size of uploaded files via form form?

    • Enctype= "Multipart/form-data", specifying how the form encodes the data.
    • Method= "POST" to specify how the data is transferred.
    • , you can control the size of the uploaded file (in bytes) by hiding the domain, and the value cannot exceed the value set by the PHP.ini profile upload_max_filesize option.

  3. How do I set a read-only property in a form form?

    • Use readonly to set the read-only property of the specified content;
    • Use the disabled implementation to set the read-only property of the specified content.

 4. Under what circumstances, $name and $_post[' name ') can be generalized?

  when register_globals = on in the php.ini file, both $name and $_post[' name ' can get the value of the table cell name in form form (submitted as POST).

However, it is not recommended to turn on register_globals all variables, because it poses a security risk to the program.

CSS Styles  

  1.What is the meaning of CSS?

  CSS (cascading style Sheet, " cascading style Sheets " or "Cascading Style sheets") language is a markup language that does not need to be interpreted and can be interpreted directly by the browser (which belongs to the browser-interpreted language) to control the appearance of the Web page. It is a set of extended style standards specified by the association to compensate for the lack of HTML in display attribute settings.

The function is as follows:

    • CSS is responsible for the performance of Web content (XHTML) in standard web design.
    • CSS files can also be said to be a text file, it contains some CSS tags, css files must use the. css as a suffix.
    • Through the CSS file to achieve the separation of content and representation, you can change the overall form of web pages, so that the maintenance of the site's appearance easier, so that the HTML document code more concise, shorten the browser load time.

2. How do i insert CSS styles into an HTML page?

    • define a pair of tags under tags in the HTML page , and use tag names, class selectors, and ID selectors to set properties inside the tag.
    • define the Style property inside the label , and then define the style under this tab, such as:

  create a. CSS style file , define the style within the file using the ID selector or class selector, and then introduce the file with the label in the HTNL Main page that appears. Such as:

  

  3.CSS Style Common Properties:

Common Properties of CSS styles
Property name Analytical
Border Define the border's properties to set the border width, color, style
Background-color Set Background color
Background-image Setting the 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, flicker, etc.
Line-height Retrieves or sets the row height of the object, which is the distance between the bottom of the font and the top of the font
Letter-spacing Retrieves or sets the interval between text in an object
Text-align Set or retrieve the alignment of text in an object

  

  

  4. How do I solve the double margin problem with the following code under IE6?

This is a common Bug under IE6, although the margin defined is 10px, but IE resolves to 20px.

Solution: Add Property display:inline

  5. How to solve the problem that the hover style does not appear after the hyperlink is clicked?

  The hyperlink style properties are sorted 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 the text in Firefox cannot open the container?

  Add two CSS properties,min-width and min-height , or add a div that clears the alignment of the class Clear:both property to automatically calculate the height of the Firefox browser.

  7. How can I define a container with a height of around 1px?

In the process of page layout, the navigation bar and the content bar often need a partition, in general, set the height of 1 pixels is the best.

DIV tags  

  1. Label and the difference:

and tags also work in web page layouts, and they differ in that:

    • span tags are inline and are typically used for small module styles inline into an HTML document
    • The DIV element itself is a block-level element that is used to combine chunks of code

  2. How do I make a DIV layer center-positioned?

  Position:absolute;

  top:50%;

  left:50%;

  margin:-100px 0 0-100px;

  3. How to solve the problem of text-align attribute of nested div tag in Filefox browser?

1 5 67  

  JavaScript scripts

  1. The function that pops up the dialog box and gets the input focus function:

Popup dialog box using the alert () function

Get input focus using the focus () function

  2. What is the steering function of JavaScript? How do I introduce an external JavaScript file?

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

Introduce an external JavaScript file:

  3. When the mouse is over the text box, the contents of the text box are automatically selected:

  

 4

  

  5. Set the JavaScript code for the home page:

  Set as homepage

  Ajax applications

  1. Use Ajax in jquery to determine whether a user name is occupied:

To define two pages, the index.php page code is as follows:

1  

The in.php page code is as follows:

 
  1 
    PHP 2$string= "Tomorrow's Technology";  3if(isset($ get[username])) {  4     if(urldecode($ get[username]) = =$string) { 5             Echo "User name is occupied"; 6     } Else {  7             Echo "User name available"; 8     }  9} ?>

2. Write the code to enter a year in the text box, judge its zodiac, and output it next to the text box, asking for the HTML and JavaScript code to be written: 

The code for the front page design is as follows:

1 <HTML>2 <Head>3 <Metahttp-equiv= "Content-type"content= "text/html;charset="UTF-8 "">4 <Scripttype= "Text/javascript"src= "Jequery-1.4.2.js"> Script>5 <title>Automatic selection of the zodiac title>6 Head>7 <Body>8 <inputtype= "text"value= "Please enter the year format"onclick= "This.select ()">9 <inputtype= "Submit"value= "judgment">Ten <span> span> One <Script> A $(function(){ - $("Input:last"). Click (function(){ - $.get ("in.php",{ the number:$ ("Input:first"). Val () - },function(data) { - $("span"). text (data); - }); + }); - }); + Script> A Body> at HTML> View Code

Background to judge the Zodiac's PHP script:

 
 1 
           PHP2if(isset($_get[number])) {3         $array =array("Pig", "rat", "ox", "Tiger", "Rabbit", "dragon", "Snake", "horse", "sheep", "monkey", "Chicken", "dog");4          foreach($arrayas$key= +$value) {5                 if(ceil($_get[number]%12) = =$key) {  6                         echo$value; 7                  }8        }9 }

  jquery Framework

Currently the more popular Client scripting language framework for jquery, created by American John Resig, is the excellent JavaScript framework, whose purpose is write less,do more. It is a lightweight JS library, compatible with CSS3, compatible with various browsers (IE 6.0+). Users can more easily handle HTML document, events, animate, and can easily provide Ajax interaction for the site. Another big advantage of jquery is that its documentation is full, and the various applications are very detailed, as well as a number of mature plugins to choose from. jquery allows the user's HTML page to keep the code and HTML content separate, that is, no longer inserting a bunch of JS in the HTML to invoke the command, just define the ID.

  Commonly used selectors in 1.jQuery:

  Basic selector:

ID Selector: Can only be used once

Class selector: Allow re-use

Tag Selector

*: Match all elements

  Hierarchy selector:

$ ("#a. B") selects all elements in an element with an ID value of a that have a class value of B.

$ ("#a >.b") selects a child element of B after the element with the ID value of a.

$ ("#a +.b") selects an element with an ID value of a that is immediately followed by a class value of B.

  Filter selector:

: First, select element One.

: Odd, select an element with an odd number of indexes.

: Even, select an element with an even number of indexes.

: not, select elements other than an element.

: eq (), searching for elements by index.

: LT (), which is less than the element of an index value.

: GT, an element that is larger than an index value.

  2. How do I find elements in the DOM tree?

  var input = $ ("Input:first");

 3. How do I create and insert elements in the DOM tree?

1 2 Fruit 3

  4. How do I replace the specified element in the DOM tree?

1 2 Fruit 3

5. Disappear a picture in the page with the fade-out effect:

1 2 3

6. Make a button that disappears with the swipe effect when the button is clicked:

1 23 $ ("Input"). Click (d=function() {4         $ (this). Slideup ("slow"); 5 }); 6

7. Photo Rotation effect:

1 2  6 7 
 
          
   
    8
  • 9
  • 10
  • 11
  • a
- -

  In view of the recent preparation of a variety of final exams and large assignments, the time of the hair Bo significantly reduced, trouble to understand Ah! This article is the use of fragmented time to edit, and now it is still quite satisfied with, if you feel that help, you can conveniently click a praise.

http://www.bkjia.com/PHPjc/1019337.html www.bkjia.com true http://www.bkjia.com/PHPjc/1019337.html techarticle PHP Job Search Series--php Web programming chapter, Job Search Web PHP Web programming Form Form 1. What is the maximum capacity for POST and GET transfers, respectively? The GET method submits the form data ...

  • Related Article

    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.