摘要:先说cookie的用法。setcookie(name,value,int expire); 创建cookie,名字,值,过期时间一般是time()+(60*60*3) ,单位second$_cookie['name'] //使用cookie删除cookie,只要设置为过期就可以了setcookie(name,value,time()-3600);设置时间为过去的任何一个时候即可。cookie是保存在客户端的,能够永久持续的,只要不过期。但是有些人设置浏览器禁用cookie,这是,application的功能对这些人可能不友好。session是存储在服务器上的,浏览器不影响ses 阅读全文
html表单元素概览
2012-02-14 13:57 by youxin, 412 阅读, 0 推荐, 收藏,
摘要:当谈到页面上的表单时,相信大家都不陌生了,注册登录什么的都要与表单打交道,现在让我们来看一下表单中最常见的标签用法.1.单行文本域(Text Field)<label>First Name</label><input type="text“ name="firstname"/> <br/><label> Last Name </label><input type="text" name="lastname"/>类型为text,name属性值一 阅读全文
php单引号和双引号的区别与用法
2012-02-13 00:09 by youxin, 18860 阅读, 5 推荐, 收藏,
摘要:php里的单引号把内容当成纯文本,不会经过服务器翻译。而双引号则与此相反。里面的内容会经过服务器处理(process).举个简单的例子:$foo="data";echo '$foo'; //单引号输出$fooecho "$foo"; //双引号输出data单引号不能处理变量和转义字符(除了\\和\'这两个),要输出下面的字符串 what's my name?可以这么来写: echo "what's my name?"; //最简单的写法,单引号和双引号不产生冲突(conflict) echo & 阅读全文
php通过session判断用户是否登录
2012-02-07 22:18 by youxin, 2498 阅读, 0 推荐, 收藏,
摘要:首先创建一个函数<?phpsession_start();function isLoggedIn() {if (isset($_SESSION[‘user_id’])) {return true;} else {return false;}}//isloggedin?> When you have a page that you want only a logged-in user to see, check at the beginning of thepage to see if she is logged in. Display the page only if the fu 阅读全文
二路插入排序详解
2012-02-03 17:20 by youxin, 1922 阅读, 0 推荐, 收藏,
摘要:二路插入排序设置两个变量first,final,把第一个数当成pivot,比它小则往前插,越小越往前插;比它大就往后插,越大越往后插,源码如下: 1 #include <stdio.h> 2 #define MAXSIZE 100 3 4 typedef int elemtype; 5 6 void BiInsertsort(elemtype buffer[],int length){ 7 elemtype tmp[MAXSIZE+1]; 8 int first,final,med; 9 int i,j;10 ... 阅读全文
php处理checkbox
2012-01-26 15:09 by youxin, 406 阅读, 0 推荐, 收藏,
摘要:<input type=”checkbox” id=”imagesonly” name=”imagesonly” value=”yes” /><label for=”imagesonly”> Check here if you only want images.</label><?phpif (isset($_GET[‘imagesonly’]) && $_GET[‘imagesonly’] == ‘Yes’) {$imagesonly = ‘Yes‘;} else {$imagesonly = ‘No‘;}echo ‘Images O 阅读全文
php $_GET变量
2012-01-25 20:28 by youxin, 334 阅读, 0 推荐, 收藏,
摘要:$_GET 变量用于收集来自 method="get" 的表单中的值。$_GET 变量$_GET 变量是一个数组,内容是由 HTTP GET 方法发送的变量名称和值。$_GET 变量用于收集来自 method="get" 的表单中的值。从带有 GET 方法的表单发送的信息,对任何人都是可见的(会显示在浏览器的地址栏),并且对发送的信息量也有限制(最多 100 个字符)。例子<form action="welcome.php" method="get">Name: <input type=" 阅读全文
filter_var()函数解释
2012-01-25 20:27 by youxin, 464 阅读, 0 推荐, 收藏,
摘要:The filter_var() function filters a variable with the specified filter.Returns the filtered data on success or FALSE on failure.Syntaxfilter_var(variable, filter, options)Optional. Specifies an associative array of flags/options or a single flag/option. Check each filter for possible options and fla 阅读全文
一份form源码实例
2012-01-25 18:23 by youxin, 295 阅读, 0 推荐, 收藏,
摘要:<form> <fieldset> <legend>Contact</legend> <label for='fullname'>Name </label> <input id="fullname" name="fullname" /type="text"/> </fieldset> <fieldset> <legend>what is your gender? </legend> < 阅读全文
html checkbox
2012-01-25 18:00 by youxin, 324 阅读, 0 推荐, 收藏,
摘要:<fieldset><legend>where do you live?</legend><input type="checkbox" id="arearural" name="areatypes[]" value="rural"/><label for="arearural">Rural </label><input type="checkbox" id="areasuburb" 阅读全文
浙公网安备 33010602011771号