国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Backend Development PHP Tutorial PHP Job Search Guide Series - PHP Web Programming

PHP Job Search Guide Series - PHP Web Programming

Aug 08, 2016 am 09:22 AM
gt javascript lt script text

PHP Web Programming

form form

  1. Briefly describe the maximum capacity of POST and GET transmission?


  • single data quilt Appended to the URL and sent to the server as part of the URL. URL length should be limited to 1MB characters.
  • The POST method does not rely on URL and does not display the passed parameter value in the address bar. In addition, the POST method can transfer data to the server without any restrictions. All submitted information is transmitted in the background and cannot be seen by the user on the browser side, which is highly secure.

2. How to control the size of uploaded files through the form?

  • enctype="multipart/form-data", specifies the way to encode data in the form.
  • method="post", specifies the data transmission method.
  • , Control the size of the uploaded file (in bytes) through the hidden field, the value Cannot exceed the value set by the php.ini configuration file upload_max_filesize option.

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

  • uses readonly to set the read-only attribute of the specified content;
  • uses disabled to set the read-only attribute of the specified content.

  4. Under what circumstances can $name and $_POST['name'] be used interchangeably?

When register_globals = On in the php.ini file, both $name and $_POST['name'] can get the value of the form element name in the form form (submitted in post mode).

But it is not recommended to turn on all the register_globals variables because it will bring security risks to the program.


CSS Styles

1.What is the meaning of CSS?

CSS (Cascading Style Sheet, translated as "Cascading Style Sheet" or "Cascading Style Sheet") language is a markup language that does not require interpretation and can be directly used by the browser Interpretation and execution (belongs to browser interpreted language) to control the appearance of Web pages. It is a set of extended style standards specified by the W3C Association to make up for the shortcomings of HTML in setting display attributes.

Its functions are as follows:

  • In standard web design, CSS is responsible for the performance of web content (XHTML).
  • A CSS file can also be said to be a text file, which contains some CSS tags. The CSS file must use the .css suffix.
  • Separation of content and presentation through CSS files can change the overall presentation of the web page, making it easier to maintain the appearance of the site, making the HTML document code more concise, and shortening the browser loading time .

  2. How many ways to insert CSS styles into HTML pages?

  • Define a pair of tags under the tag in the HTML page, and use the tag name and class inside the tag Selector and id selector set attributes.
  • Define the style attribute inside the tag, and then define the style under this tag, such as:

Link Use the tag to import files. Such as:

3. Commonly used attributes of CSS styles:

Commonly used attributes of CSS styles
Attribute name parsing
border define the properties of the border to set the width, color, and style of the border
background-color Set the background color
background-image Set the background image
font-size Set the font size
font-family Set the font
text-decoration Retrieve or set the decoration of the text in the object , such as underlining, blinking, etc.
line-height Retrieve or set the line height of the object, that is, the distance between the bottom of the font and the top of the font inside
letter-spacing Retrieve or set the object The spacing between text
text-align Sets or retrieves the alignment of text in an object


4. How to solve the problem of the following code under IE6 Double margin issue?

<span><span><style type="text/css">
body </span>{<span>margin</span>:<span>0</span>;}<span>div  </span>{<span>float</span>:<span>left</span>;  <span>margin-left</span>:<span>10px</span>;<span>    width</span>:<span>200px</span>;<span>    height</span>:<span>200px</span>;  <span>border</span>:<span>1px</span>;<span>    solid red;</span>}<span></style></span></span>

 This is a common bug under IE6. Although the defined margin is 10px, IE parses it as 20px.

Solution: Add the attribute display:inline

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

Just 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 to solve the problem under Firefox browser Text cannot expand the height of the container?

Add two CSS properties, min-width and min-height. You can also add a div with a clear:both attribute to clear the alignment to automatically calculate the height of the Firefox browser. .

7. How to define a container with a height of about 1px?

In the process of web page layout, a partition is often needed between the navigation bar and the content bar. Generally, setting a height of 1 pixel is optimal.


DIV tag

1. The difference between tags and

:

 

and Tags also work in web page layout. The difference between them is:

  • span tags are inline and are generally used to inline the styles of small modules into HTML documents
  • div elements themselves are blocks level element, mostly used to combine large blocks of code

2. How to center a DIV layer?

position:absolute;

top:50%;

left:50%;

margin: -100 px 0 0 -100px;

3. How to solve the problem of invalid text-align attribute of nested div tags in filefox browser?

<span>1</span><span><style>
</span><span>2</span><span>.one </span>{<span>border</span>:<span>1px solid blue</span>;<span>width</span>:<span>300px</span>;<span>height</span>:<span>200px</span>;<span>text-align</span>:<span>center </span>}
<span>3</span><span>.two </span>{<span>border</span>:<span>1 px solid blue</span>;<span>width</span>:<span>200px</span>;<span>height</span>:<span>100px</span>;<span>margin</span>:<span>0px auto </span>}
<span>4</span><span></style>
</span><span>5</span><span><div>
</span><span>6</span><span><div></div>
</span><span>7</span><span></div></span>

JavaScript script

1. The function of popping up the dialog box and the function of getting the input focus:

Use the alert() function to pop up a dialog box

Use the focus() function to get input focus

2. What is the redirect function of JavaScript? How to import an external JavaScript file?

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

  Introducing external JavaScript files:

3. When the mouse passes over the text box, the content in the text box is automatically selected:

5. JavaScript code to set the homepage:

Ajax application
1. Use Ajax in jQuery to determine whether the user name is occupied:

Need to define two pages , index.php page code is as follows:

 1 <script type="text/javascript" src="jquery-1.4.2.js"></script>
 2 <input type="text" ><input type="button" value="校驗(yàn)">
 3 <script type="text/javascript">
 4 $(<span>function</span><span>() {
 </span>5       $("input:last".click(<span>function</span><span>() {
 </span>6             $.get ("in.php",<span> {
 </span>7                     username:$("input:first").<span>val()
 </span>8             },<span>function</span><span>(data) {
 </span>9<span>                     alert (data);
 </span>10             })'<span> 11        });
 12 });
 13 </script></span>  in.php page code is as follows: <pre class="brush:php;toolbar:false"><span> 1</span> <?<span>php
</span><span> 2</span><span>$string</span>="明日科技"<span>;
</span><span> 3</span><span>if</span>(<span>isset</span><span>($ GET[username])) {
</span><span> 4</span><span>if</span>(<span>urldecode</span>($ GET[username])==<span>$string</span><span>) {
</span><span> 5</span><span>echo</span> "用戶名被占用"<span>;
</span><span> 6</span>     }<span>else</span><span>{
</span><span> 7</span><span>echo</span> "用戶名可用"<span>;
</span><span> 8</span><span>    }
</span><span> 9</span><span>}
</span><span>10</span> ?>

2. Write code to enter a year in the text box and judge Its zodiac sign, and output next to the text box, requires writing HTML and JavaScript code:


The code for the front page design is as follows:

<span> 1</span><span><</span><span>html</span><span>></span><span> 2</span><span><</span><span>head</span><span>></span><span> 3</span><span><</span><span>meta </span><span>http-equiv</span><span>="Content-type"</span><span> content</span><span>="text/html;charset="</span><span>UTF-8""</span><span>></span><span> 4</span><span><</span><span>script </span><span>type</span><span>="text/javascript"</span><span> src</span><span>="jequery-1.4.2.js"</span><span>></</span><span>script</span><span>></span><span> 5</span><span><</span><span>title</span><span>></span>生肖的自動(dòng)選擇<span></</span><span>title</span><span>></span><span> 6</span><span></</span><span>head</span><span>></span><span> 7</span><span><</span><span>body</span><span>></span><span> 8</span><span><</span><span>input </span><span>type</span><span>="text"</span><span> value</span><span>="請(qǐng)輸入年份格式為2015"</span><span> onclick</span><span>="this.select()"</span><span>></span><span> 9</span><span><</span><span>input </span><span>type</span><span>="submit"</span><span> value</span><span>="判斷"</span><span>></span><span>10</span><span><</span><span>span</span><span>></</span><span>span</span><span>></span><span>11</span><span><</span><span>script</span><span>></span><span>12</span><span>    $(</span><span>function</span><span>(){
</span><span>13</span><span>        $(</span><span>"</span><span>input:last</span><span>"</span><span>).click(</span><span>function</span><span>(){
</span><span>14</span><span>            $.get(</span><span>"</span><span>in.php</span><span>"</span><span>,{
</span><span>15</span><span>                number:$(</span><span>"</span><span>input:first</span><span>"</span><span>).val()
</span><span>16</span><span>            },</span><span>function</span><span>(data){
</span><span>17</span><span>                    $(</span><span>"</span><span>span</span><span>"</span><span>).text(data);
</span><span>18</span><span>            });
</span><span>19</span><span>        });
</span><span>20</span><span>});
</span><span>21</span><span></</span><span>script</span><span>></span><span>22</span><span></</span><span>body</span><span>></span><span>23</span><span></</span><span>html</span><span>></span>

View Code
  PHP script to determine the zodiac sign in the background:

<span>1</span> <?<span>php
</span><span>2</span><span>if</span>(<span>isset</span>(<span>$_GET</span>[<span>number</span><span>])){
</span><span>3</span><span>$array</span>=<span>array</span>("豬","鼠","牛","虎","兔","龍","蛇","馬","羊","猴","雞","狗"<span>);
</span><span>4</span><span>foreach</span>(<span>$array</span><span>as</span><span>$key</span>=><span>$value</span><span>) {
</span><span>5</span><span>if</span>(<span>ceil</span>(<span>$_GET</span>[<span>number</span>]%12)==<span>$key</span><span>){
</span><span>6</span><span>echo</span><span>$value</span><span>;
</span><span>7</span><span>                 }
</span><span>8</span><span>        }
</span><span>9</span> }

jQuery framework

  目前比較流行的客戶端腳本語言框架jQuery,由美國人John?Resig創(chuàng)建,是優(yōu)秀的JavaScript框架,其宗旨是write less,do more.它是輕量級(jí)的js庫,兼容CSS3,兼容各種瀏覽器(IE 6.0+)。用戶能更方便地處理HTML?document、events,實(shí)現(xiàn)動(dòng)畫效果,并且可以方便地為網(wǎng)站提供AJAX交互。jQuery另一個(gè)比較大的優(yōu)勢(shì)是,它的文檔說明很全,而且各種應(yīng)用也說的很詳細(xì),同時(shí)還有許多成熟的插件可供選擇。jQuery能夠使用戶的HTML頁保持代碼和HTML內(nèi)容的分離,也就是說,不用再在HTML里面插入一堆js來調(diào)用命令了,只需定義id即可。

1.jQuery中常用選擇器:

基本選擇器:

  id選擇器:只能用一次

  class選擇器:允許重復(fù)使用

  標(biāo)簽選擇器

  *:匹配所有元素

層次選擇器:

  $("#a.b")?選取id值為a的元素里所有class值為b的元素。

  $("#a>.b")?選取id值為a的元素后的class值為b的子元素。

  $("#a+.b")?選取id值為a的元素后緊挨的class值為b的元素。

過濾選擇器:

 ?。篺irst,選取第一個(gè)元素。

 ?。簅dd,選取索引是奇數(shù)的元素。

 ?。篹ven,選取索引是偶數(shù)的元素。

  :not,選取除某元素外的其他元素。

  :eq(),按索引尋找元素。

  :lt(),小于某索引值的元素。

 ?。篻t,大于某索引值的元素。

2.如何實(shí)現(xiàn)查找DOM樹中的元素?

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

 3.如何在DOM樹中創(chuàng)建并插入元素?

<span>1</span> <script type="text/javascript" src="jquery-1.4.2.js"></script>
<span>2</span> <div>水果</div>
<span>3</span> <script>
<span>4</span><span>var</span> title=$("<span>蘋果</span>"<span>);
</span><span>5</span> $("div").append(title);<span>//</span><span>將title追加到div標(biāo)簽內(nèi)容的后面</span><span>6</span> $("div").before(title);<span>//</span><span>將title追加到div標(biāo)簽之前與div標(biāo)簽屬于同一層次</span><span>7</span> $("div").prepend(title);<span>//</span><span>將title追加到div標(biāo)簽內(nèi)容之前</span><span>8</span> $("div").after(title);<span>//</span><span>將title追加到div標(biāo)簽之后與div標(biāo)簽屬于同一層次</span><span>9</span> </script>

4.如何在DOM樹中替換指定元素?

<span>1</span> <script type="text/javascript" src="jquery-1.4.2.js"</script>
<span>2</span> <div>水果</div>
<span>3</span> <script>
<span>4</span><span>var</span> title=$("<span>蘋果</span>"<span>);
</span><span>5</span> $("div"<span>).replaceWith(title);
</span><span>6</span> </script>

  5.將一張圖片以淡出的效果消失在頁面中:

<span>1</span> <script type="text/javascript" src="jquery-1.4.2.js"></script>
<span>2</span> <img src="color.jpg">
<span>3</span> <script>
<span>4</span> $("img".click(<span>function</span><span>(){
</span><span>5</span>     $(<span>this</span>).fadeOut("slow"<span>);
</span><span>6</span><span>});
</span><span>7</span> </script>

  6.制作一個(gè)按鈕,當(dāng)按鈕被單擊時(shí)以卷簾效果消失:

<span>1</span> <script type="text/javascript" src="jquery-1.4.2.js"></script>
<span>2</span> <input type="button" value="按鈕"><script>
<span>3</span> $("input").click(d=<span>function</span><span>(){
</span><span>4</span>         $(<span>this</span>).slideUp("slow"<span>);
</span><span>5</span><span>});
</span><span>6</span> </script>

  7.照片輪換效果:

<span> 1</span> <script type="text/javascript" src="jquery-1.4.2.js"></script>
<span> 2</span> <style>
<span> 3</span> ul{list-<span>style:none;width:350px;height:200px;position:absolute}
</span><span> 4</span><span>li{position:ansolute}
</span><span> 5</span> </style>
<span> 6</span> <div>
<span> 7</span> <ul>
<span> 8</span> <li><img ssrc="1.jpg" width=350px height=200px></li>
<span> 9</span> <li><img ssrc="2.jpg" width=350px height=200px></li>
<span>10</span> <li><img ssrc="3.jpg" width=350px height=200px></li>
<span>11</span> <li><img ssrc="4.jpg" width=350px height=200px></li>
<span>12</span> </ul>
<span>13</span> </div>
<span>14</span> <script>
<span>15</span> $(<span>function</span><span>(){
</span><span>16</span>     $(."change ul li:not(:first)"<span>).hide();
</span><span>17</span>     setInterval(<span>function</span><span>(){
</span><span>18</span><span>if</span>($."change ul li:last").is(":visible"<span>)){
</span><span>19</span>             $(."change ul li:first").fadeIn("slow"<span>);
</span><span>20</span>             $(."change ul li:last"<span>).hide();
</span><span>21</span>     }<span>else</span><span>{
</span><span>22</span>             $(."change ul li:visible").next().fadeIn("slow"<span>);
</span><span>23</span><span>    }
</span><span>24</span>   },1000<span>);
</span><span>25</span><span>});
</span><span>26</span> </script>   

鑒于最近要準(zhǔn)備各種期末考和大作業(yè),發(fā)博時(shí)間明顯減少,勞煩多多理解?。”酒际抢昧闼闀r(shí)間編輯的,現(xiàn)在大功告成還是挺滿足啦,若您覺得有幫助,可以隨手點(diǎn)個(gè)贊。

以上就介紹了PHP求職寶典系列——PHP Web 編程篇,包括了方面的內(nèi)容,希望對(duì)PHP教程有興趣的朋友有所幫助。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the differences between Huawei GT3 Pro and GT4? What are the differences between Huawei GT3 Pro and GT4? Dec 29, 2023 pm 02:27 PM

Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems WebSocket and JavaScript: key technologies for implementing real-time monitoring systems Dec 17, 2023 pm 05:30 PM

WebSocket and JavaScript: Key technologies for realizing real-time monitoring systems Introduction: With the rapid development of Internet technology, real-time monitoring systems have been widely used in various fields. One of the key technologies to achieve real-time monitoring is the combination of WebSocket and JavaScript. This article will introduce the application of WebSocket and JavaScript in real-time monitoring systems, give code examples, and explain their implementation principles in detail. 1. WebSocket technology

How to implement an online speech recognition system using WebSocket and JavaScript How to implement an online speech recognition system using WebSocket and JavaScript Dec 17, 2023 pm 02:54 PM

How to use WebSocket and JavaScript to implement an online speech recognition system Introduction: With the continuous development of technology, speech recognition technology has become an important part of the field of artificial intelligence. The online speech recognition system based on WebSocket and JavaScript has the characteristics of low latency, real-time and cross-platform, and has become a widely used solution. This article will introduce how to use WebSocket and JavaScript to implement an online speech recognition system.

How to use JavaScript and WebSocket to implement a real-time online ordering system How to use JavaScript and WebSocket to implement a real-time online ordering system Dec 17, 2023 pm 12:09 PM

Introduction to how to use JavaScript and WebSocket to implement a real-time online ordering system: With the popularity of the Internet and the advancement of technology, more and more restaurants have begun to provide online ordering services. In order to implement a real-time online ordering system, we can use JavaScript and WebSocket technology. WebSocket is a full-duplex communication protocol based on the TCP protocol, which can realize real-time two-way communication between the client and the server. In the real-time online ordering system, when the user selects dishes and places an order

JavaScript and WebSocket: Building an efficient real-time weather forecasting system JavaScript and WebSocket: Building an efficient real-time weather forecasting system Dec 17, 2023 pm 05:13 PM

JavaScript and WebSocket: Building an efficient real-time weather forecast system Introduction: Today, the accuracy of weather forecasts is of great significance to daily life and decision-making. As technology develops, we can provide more accurate and reliable weather forecasts by obtaining weather data in real time. In this article, we will learn how to use JavaScript and WebSocket technology to build an efficient real-time weather forecast system. This article will demonstrate the implementation process through specific code examples. We

How to implement an online reservation system using WebSocket and JavaScript How to implement an online reservation system using WebSocket and JavaScript Dec 17, 2023 am 09:39 AM

How to use WebSocket and JavaScript to implement an online reservation system. In today's digital era, more and more businesses and services need to provide online reservation functions. It is crucial to implement an efficient and real-time online reservation system. This article will introduce how to use WebSocket and JavaScript to implement an online reservation system, and provide specific code examples. 1. What is WebSocket? WebSocket is a full-duplex method on a single TCP connection.

Simple JavaScript Tutorial: How to Get HTTP Status Code Simple JavaScript Tutorial: How to Get HTTP Status Code Jan 05, 2024 pm 06:08 PM

JavaScript tutorial: How to get HTTP status code, specific code examples are required. Preface: In web development, data interaction with the server is often involved. When communicating with the server, we often need to obtain the returned HTTP status code to determine whether the operation is successful, and perform corresponding processing based on different status codes. This article will teach you how to use JavaScript to obtain HTTP status codes and provide some practical code examples. Using XMLHttpRequest

How to use insertBefore in javascript How to use insertBefore in javascript Nov 24, 2023 am 11:56 AM

Usage: In JavaScript, the insertBefore() method is used to insert a new node in the DOM tree. This method requires two parameters: the new node to be inserted and the reference node (that is, the node where the new node will be inserted).

See all articles