网站开发与移动开发

博客园 首页 新随笔 管理
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 33 下一页

2009年5月27日 #

摘要: PHP代码: <? $lan = substr(?$HTTP_ACCEPT_LANGUAGE,0,5); if ($lan == "zh-cn") print("<meta http-equiv='refresh' content = '0;URL = gb/index.htm'>"); else print("<meta http-equiv='refresh' content = '0;URL = eng/index.htm'>"); ? 阅读全文
posted @ 2009-05-27 11:44 txf2004 阅读(140) 评论(0) 推荐(0) 编辑

2009年5月25日 #

摘要: 标题:彻底杜绝warning: Cannot add header information - headers already sent in......作者:esayr出自:www.phpv.net-->PHP研究室只要你写过PHP代码,相信都遇上过这个大多时候都令人莫明其妙的warning吧..今天我们就来搞定它...............看了PHP手册,回答如下:6. 我得到消息“Warning: Cannot send session cookie - headers already sent...”或者“Cannot add header information - head 阅读全文
posted @ 2009-05-25 21:10 txf2004 阅读(169) 评论(0) 推荐(0) 编辑

2009年5月23日 #

摘要: 说明:原动态地址为 moban.php?id=1 ,生成后地址为 html/200808/sell_1.html 。page.php为分页程序 页面使用方式,将本代码保存为make.php,使用方法为浏览器访问 make.php?t=数量&pg=页面;例如 make.php?t=300&pg=2,即每次生成300条数据,从数据列表第2页开始生成,即跳过前面300条。如果不加任何参数,直接访问make.php,则默认每次生成200条,从第一页开始生成。 <?php if($_GET[pg]==''){ $aa=1; }else{ $aa=$_GET[pg]; 阅读全文
posted @ 2009-05-23 09:34 txf2004 阅读(238) 评论(0) 推荐(0) 编辑

2009年5月21日 #

摘要: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>一个层关闭之后,就算刷新页面了也不显示。除非关闭页面再次打开</title> &l 阅读全文
posted @ 2009-05-21 21:31 txf2004 阅读(180) 评论(0) 推荐(0) 编辑

2009年5月20日 #

摘要: 使用的xajax版本是0.5.4beta,fckeditor版本是2.4.3,通过xajax给fckeditor增加自动保存草稿功能, 本文侧重于演示,使用sessionid记录对应关系,用户关闭浏览器後数据就会消失,在实际应用中可以使用数据库存储数据,修改保存函数autosave和调用函数loadcache 即可. <?php session_start(); define('ROOT_DIR',str_replace("/","/",dirname(__FILE__))); $cachedir = './cache/&# 阅读全文
posted @ 2009-05-20 10:09 txf2004 阅读(208) 评论(0) 推荐(0) 编辑

2009年5月19日 #

摘要: xajax向html页面输出fckeditor是容易的,但是xajax如何获取fckeditor的值?在xajax的wiki上说了,但还是不明白,测试不成功,最后在fckeditor 2.4.3的_samples/html/sample08.html中找到了答案 function GetContents() { // Get the editor instance that we want to interact with. var oEditor = FCKeditorAPI.GetInstance('content1') ; // Get the editor conten 阅读全文
posted @ 2009-05-19 08:22 txf2004 阅读(182) 评论(0) 推荐(0) 编辑

2009年5月17日 #

摘要: http://www.corange.cn/archives/2008/10/2080.html主要的xajax结合php上传文件和保存数据的函数集中存放在 ./admin/includes/function.xajax.php 里面 在language.php文件载入并初始化xajax上传扩展 require_once(ROOT_PATH . '/includes/xajax/xajax.inc.php'); require_once(ROOT_PATH . '/admin/includes/function.xajax.php'); require_once 阅读全文
posted @ 2009-05-17 10:03 txf2004 阅读(191) 评论(0) 推荐(0) 编辑

2009年5月16日 #

摘要: 下载地址 http://www.corange.cn//uploadfiles/ajax[1].select_22983.rar <script>window.onload = function(){getPage("http://localhost/xuexi/tuodong/xajaxcontent.htm?"+new Date().getTime(),"content");}</script> 注意文件路径,你下载演示时候可以看到 阅读全文
posted @ 2009-05-16 00:13 txf2004 阅读(116) 评论(0) 推荐(0) 编辑

2009年5月15日 #

摘要: http://www.corange.cn/archives/2008/10/2077.htmlCSS: <style type="text/css"> input.txtInput { background: #fff; background-repeat: no-repeat; background-position: 2px center; border:1px solid #999; padding:2px 2px 2px 20px; } input.searchInput {background-image: url(search.gif);} inp 阅读全文
posted @ 2009-05-15 00:03 txf2004 阅读(173) 评论(0) 推荐(0) 编辑

2009年5月14日 #

摘要: 为了方便阅读,我们通常会在一串长数字中加入“千位分隔符”,即将 1234567890.11 转换成 1,234,567,890.11 ,这样的任务交给正则表达式来处理再方便不过了,本文就介绍了这个问题的解决方法。 语法: Code: (?<=[0-9])(?=(?:[0-9]{3})+(?![0-9])) 使用范例: PHP: <?php // 说明:在数值中加入千位分隔符的方法 // 整理:CodeBit.cn ( http://www.CodeBit.cn ) $num = "1234567890.11"; $num = preg_replace(' 阅读全文
posted @ 2009-05-14 09:33 txf2004 阅读(338) 评论(0) 推荐(0) 编辑

2009年5月13日 #

摘要: 在用 Javascript 验证表单(form)中的单选框(radio)是否选中时,很多新手都会遇到问题,原因是 radio 和普通的文本框在获取值的时候有很大不同,本文介绍了一个较为通用的获取 radio 值的方法,希望对新手有用。 -------------------------------------------------------------- 点此浏览示例文件 -------------------------------------------------------------- Javascript: <script type="text/javascri 阅读全文
posted @ 2009-05-13 08:34 txf2004 阅读(250) 评论(0) 推荐(0) 编辑

2009年5月11日 #

摘要: 不论是对浏览者还是对搜索引擎,文字都是最佳的页面内容展示方式,但是,由于字体等原因的限制,纯文字的展示渐渐无法满足爱美的设计师的要求。 于是,出现了通过 CSS 来实现用图片替换文字的方法,这种方式既能实现页面上各种丰富的效果,又能满足搜索引擎优化的需要。因此,深受网页设计师的喜爱,本文介绍了几种常见的图文替换技术。 Fahrner Image Replacement (FIR) Phark 的方法 Gilder/Levin 的方法 (推荐) Fahrner Image Replacement (FIR) 这是最早出现的图文替换技术,是由 Todd Fahrner 提出的,非常容易理解: HT 阅读全文
posted @ 2009-05-11 22:39 txf2004 阅读(170) 评论(0) 推荐(0) 编辑

2009年5月10日 #

摘要: 和单选框一样,许多新手在用 Javascript 验证表单(form)中多选框(checkbox)的值时,都会遇到问题,原因是 checkbox 和普通的文本框在获取值的时候有很大不同,本文介绍了一个较为通用的获取 checkbox 值的方法,希望对新手有用。 -------------------------------------------------------------- 点此浏览示例文件 -------------------------------------------------------------- Javascript: <script type=" 阅读全文
posted @ 2009-05-10 21:56 txf2004 阅读(227) 评论(0) 推荐(0) 编辑

2009年4月29日 #

摘要: 阅读全文
posted @ 2009-04-29 10:20 txf2004 阅读(152) 评论(0) 推荐(0) 编辑

2009年4月24日 #

摘要: 首先看文件结构: /inc 包含function.php文件和数据操作类 /index.php html代码和州的收据获取代码 /ajax_city.php 城市数据的获取代码 /ajax.js httpRequest的建立和异步请求 index.php文件: ajax联动下拉框菜单 ".$rows['state_name'].""; } ?> please select state first ajax.js文件: var xmlHttp = createXmlHttpRequestObject(); function createXmlH 阅读全文
posted @ 2009-04-24 15:28 txf2004 阅读(228) 评论(0) 推荐(0) 编辑

2009年4月23日 #

摘要: ajax.js /** * ajax无刷新二级联动下拉菜单(省市联动) * * @author arcow * @version 1.0 * @lastupdate 2005-12-29 * */ var http_request = false; function send_request(url,method) {//初始化、指定处理函数、发送请求的函数 http_request = false; //开始初始化XMLHttpRequest对象 if(window.XMLHttpRequest) { //Mozilla 浏览器 http_request = new XMLHttpR... 阅读全文
posted @ 2009-04-23 10:41 txf2004 阅读(295) 评论(0) 推荐(0) 编辑

2009年4月19日 #

摘要: 要在write.php页面放一个二级联动,则在write.php页面要放置二级联动的地方加一句require_once("ld2.php");若write.php要向save.php页面提交数据则在save.php中使用$bigclass=$_POST["bigclass"];//取得大类的id值$smallclass=$_POST["smallclass"];//取得小类的id值接下来就知道该怎么做了吧。 <?php /******************************************* ********** 阅读全文
posted @ 2009-04-19 23:34 txf2004 阅读(275) 评论(0) 推荐(0) 编辑

2009年4月15日 #

摘要: - echo 是命令,不能返回值。echo后面可以跟很多个参数,之间用分号隔开,如: echo $myvar1; echo 1,2,$myvar,"<b>bold</b>"; - print 是函数,可以返回一个值,只能有一个参数。 - printf 函数,把文字格式化以后输出,如: $name="hunte"; $age=25; printf("my name is %s, age %d", $name, $age); - sprintf 跟printf相似,但不打印,而是返回格式化后的文字,其他的与prin 阅读全文
posted @ 2009-04-15 11:42 txf2004 阅读(128) 评论(0) 推荐(0) 编辑

2009年4月12日 #

摘要: 两个函数在格式化带有英文字符的html代码的时候基本没啥问题,但是htmlentities对中文字符也不放过,这样得出来的结果是中文字符部分变为一堆乱码。 The translations performed are: ‘&’ (ampersand) becomes ‘&’ ‘”‘ (double quote) becomes ‘”‘ when ENT_NOQUOTES is not set. ”’ (single quote) becomes ”’ only when ENT_QUOTES is set. ‘<’ (less than) becomes ‘<’ ‘ 阅读全文
posted @ 2009-04-12 21:35 txf2004 阅读(131) 评论(0) 推荐(0) 编辑

2009年4月6日 #

摘要: http://www.corange.cn/archives/2008/10/2058.html<scrīpt language="text/javascrīpt"> var checkflag = false; function check(field) { if (!checkflag) { for (i = 0; i < field.length; i++) { field[i].checked = true; } checkflag = "true"; return "不选"; } else { for (i 阅读全文
posted @ 2009-04-06 20:51 txf2004 阅读(172) 评论(0) 推荐(0) 编辑

上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 33 下一页