PHP Web Programming
form form
1. Briefly describe what is the maximum capacity of POST and GET transmission?
2. How to control the size of uploaded files through the form?
3. How to set the read-only attribute in the form?
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 obtain the form elements in the form form The value of name (submitted in post mode).
However, it is not recommended to enable all register_globals variables, because it will bring security risks to the program.
CSS style
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 interpreted and executed by the browser (it 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 W3C Association to make up for the shortcomings of HTML in setting display attributes.
Its functions are as follows:
2. How many ways to insert CSS styles into HTML pages?
, use id selectors or class selectors to define the style inside the file, and then use the tag to introduce the file in the displayed HTNL main page . Such as:
3. CSS style common attributes: 4. How to solve the double margin problem of the following code under IE6? This is a common bug under IE6. Although the defined margin is 10px, IE parses it as 20px. Solution: Add 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 that text cannot open the height of the container in Firefox browser? Add two CSS properties, min-width and min-height , which can also be added A div with clear alignment class clear:both attribute to automatically calculate the height in Firefox. 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 The 2. How to center a DIV layer? position:absolute; top:50%; left:50%; margin:-100px 0 0 -100px; 3. How to solve the problem of invalid text-align attribute of nested div tags in filefox browser? JavaScript 1. Function to pop up the dialog box and get input focus function: Use the alert() function To obtain the input focus, use the focus() function 2. What is the redirection function in 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: 4 5. Set the JavaScript code of the homepage: Ajax 应用 1.利用 jQuery中的Ajax判断用户名是否被占用: 需要定义两个页面,index.php 页面代码如下: in.php 页面代码如下: 2. 编写代码,使得在文本框中输入一个年份,判断其生肖,并在文本框旁边输出,要求写出HTML和JavaScript代码: 前台页面设计的代码如下: 后台判断生肖的PHP脚本: jQuery框架 目前比较流行的客户端脚本语言框架jQuery,由美国人John Resig创建,是优秀的JavaScript框架,其宗旨是write less,do more.它是轻量级的js库,兼容CSS3,兼容各种浏览器(IE 6.0+)。用户能更方便地处理HTML document、events,实现动画效果,并且可以方便地为网站提供AJAX交互。jQuery另一个比较大的优势是,它的文档说明很全,而且各种应用也说的很详细,同时还有许多成熟的插件可供选择。jQuery能够使用户的HTML页保持代码和HTML内容的分离,也就是说,不用再在HTML里面插入一堆js来调用命令了,只需定义id即可。 1.jQuery中常用选择器: 基本选择器: id选择器:只能用一次 class选择器:允许重复使用 标签选择器 *:匹配所有元素 层次选择器: $("#a.b") 选取id值为a的元素里所有class值为b的元素。 $("#a>.b") 选取id值为a的元素后的class值为b的子元素。 $("#a+.b") 选取id值为a的元素后紧挨的class值为b的元素。 过滤选择器: :first,选取第一个元素。 :odd,选取索引是奇数的元素。 :even,选取索引是偶数的元素。 :not,选取除某元素外的其他元素。 :eq(),按索引寻找元素。 :lt(),小于某索引值的元素。 :gt,大于某索引值的元素。 2.如何实现查找DOM树中的元素? var input = $("input:first"); 3.如何在DOM树中创建并插入元素? 4.如何在DOM树中替换指定元素? 5.将一张图片以淡出的效果消失在页面中: 6.制作一个按钮,当按钮被单击时以卷帘效果消失: 7.照片轮换效果: 鉴于最近要准备各种期末考和大作业,发博时间明显减少,劳烦多多理解啊!本篇都是利用零碎时间编辑的,现在大功告成还是挺满足啦,若您觉得有帮助,可以随手点个赞。
属性名称
解析
border
定义边框的属性可以设置边框的宽度、颜色、样式
background-color
设置背景颜色
background-image
设置背景图像
font-size
设置字体大小
font-family
设置字体
text-decoration
检索或设置对象中文本的装饰,如下划线、闪烁等
line-height
检索或设置对象的行高,即字体最底端与字体内部顶端之间的距离
letter-spacing
检索或设置对象中的文字之间的间隔
text-align
设置或检索对象中文本的对齐方式
<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>
<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 class="one">
</span><span>6</span> <span><div class="two"></div>
</span><span>7</span> <span></div></span>
1 <script type="text/javascript" src="jquery-1.4.2.js"></script>
2 <input type="text" ><input type="button" value="校验">
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>
<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> ?>
<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> }
<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标签内容的后面</span>
<span>6</span> $("div").before(title);<span>//</span><span>将title追加到div标签之前与div标签属于同一层次</span>
<span>7</span> $("div").prepend(title);<span>//</span><span>将title追加到div标签内容之前</span>
<span>8</span> $("div").after(title);<span>//</span><span>将title追加到div标签之后与div标签属于同一层次</span>
<span>9</span> </script>
<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>
<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>
<span>1</span> <script type="text/javascript" src="jquery-1.4.2.js"></script>
<span>2</span> <input type="button" value="按钮">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>
<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 class="change">
<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>