Server.CreateObject 失败
作者:阿川 发布时间:April 25, 2009 分类:编程开发
今天在给左拉装downplus的时候发现后台添加软件出现Server.CreateObject 失败,出现问题的文件是inc_commonfunction.asp中地第四行
Set objTypeLib = Server.CreateObject("Scriptlet.TypeLib")
php的还真他妈不好学啊
作者:阿川 发布时间:April 10, 2009 分类:编程开发
还是没找到如何学的方法,只能用最原始的了.俗话说:好记性.不如烂笔头.这话说的还真对.以后俺写个代码.就在博客上放一个.写一个放一个.一来方便自己查看,二来也能加强自己的记忆.感觉还是不错的.
今天学习的是php的文件系统.第一个系统变量是pathinfo.这哥们好像好好几个属性.我们来测试下.
$path_parts = pathinfo(__FILE__); print_r ($path_parts); echo $path_parts['dirname'];
FCKeditor的配置文件一个.
作者:阿川 发布时间:April 7, 2009 分类:编程开发
一个配置而已,也是明天办公室要用到的.
include('fckeditor.php') ; $sBasePath = $_SERVER['PHP_SELF'] ; $sBasePath = dirname($sBasePath).'/'; $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = $sBasePath ; $oFCKeditor->ToolbarSet='Basic'; if($_POST[sub]){ echo "标题".$_POST[title]; echo "内容".$_POST[FCKeditor1]; } ?> <form action="" method="post" > <input type="text" name="title" value="" /> <?php $oFCKeditor->Value='初始值'; $oFCKeditor->Create(); ?> <input type="submit" name="sub" value="添加新闻" /> </form>
COOKIE &&Session
作者:阿川 发布时间:April 7, 2009 分类:编程开发
cookie代码一个,实现登陆以后自己跳转.设置时间以后,设置的时间内不会失效
session是即时生效的.但是需要在头部申明:session_start();
下面是cookie的基本代码
<?php /* * Created on 2009-4-7 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ if($_GET[out]){ setcookie('id',''); setcookie('pass',''); echo "<script>location.herf='cookie.php'</script>"; } if($_POST[name] && $_POST[password]){ setcookie('id',$_POST[name],time()+3600); setcookie('pass',$_POST[password],time()+3600); } if($_COOKIE[id] && $_COOKIE[pass]){ echo "登陆成功"; echo $_COOKIE[id]."密码是".$_COOKIE[pass]; echo "<script>location.herf='cookie.php'</script>"; echo "<br><a href='cookie.php?out=out'>退出</a>"; } ?> <form action="" method="post"> 用户ID: <input name="name" type="text"><br> 密码: <input name="password" type="password"><br> <input type='submit' value="提交"> </form>
再来一个smarty的基本配置
作者:阿川 发布时间:April 6, 2009 分类:编程开发
就不传到空间了.,明天要用的
<?php /* * Created on 2009-4-1 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ include_once("libs/smarty.class.php");//引入smarty类 $smarty =new smarty();//建立smarty实例对象$smarty $smarty->config_dir="lib/config_file.class.php";//目录变量 $smarty->caching = false;//是否使用缓存; $smarty->templates_dir="./templates";//设置模板目录 $smarty->compile_dir ="./templates_c";//设置编译目录 $smarty->cache_dir="./smarty_cache";//缓存文件夹 //=========================================== //设置左右边界符 $smarty->left_delimiter="{"; $smarty->right_delimiter="}"; ?>
一个数据库链接的类
作者:阿川 发布时间:April 6, 2009 分类:编程开发
类这玩意的确是个好东西.可以先写好,然后留着以后拿出来用,调用简单,而且方便,不用改来该去的.这些类就先自己留着.以后慢慢的玩.下面是个数据库链接的类和几个实用的方法,主要有call和查询,连接等等
一些PHP的常用函数
作者:阿川 发布时间:April 2, 2009 分类:编程开发
今天百度了下,搜索到这些内容,希望对以后的开发有帮助
获取访问者浏览器
<? function browse_infor() { $browser="";$browserver=""; $Browsers =array("Lynx","MOSAIC","AOL","Opera","JAVA","MacWeb","WebExplorer","OmniWeb"); $Agent = $GLOBALS["HTTP_USER_AGENT"]; for ($i=0; $i<=7; $i++) { if (strpos($Agent,$Browsers[$i])) { $browser = $Browsers[$i]; $browserver =""; } } if (ereg("Mozilla",$Agent) && !ereg("MSIE",$Agent)) { $temp =explode("(", $Agent); $Part=$temp[0]; $temp =explode("/", $Part); $browserver=$temp[1]; //oSPHP.COM.CN $temp =explode(" ",$browserver); $browserver=$temp[0]; $browserver =preg_replace("/([d.]+)/","1",$browserver); $browserver = " $browserver"; $browser = "Netscape Navigator"; } if (ereg("Mozilla",$Agent) && ereg("Opera",$Agent)) { $temp =explode("(", $Agent); $Part=$temp[1]; //OSPHP.com.CN $temp =explode(")", $Part); $browserver=$temp[1]; $temp =explode(" ",$browserver);$browserver=$temp[2]; $browserver =preg_replace("/([d.]+)/","1",$browserver); $browserver = " $browserver"; $browser = "Opera"; } if (ereg("Mozilla",$Agent) && ereg("MSIE",$Agent)) { $temp = explode("(", $Agent); $Part=$temp[1]; $temp = explode(";",$Part); $Part=$temp[1]; $temp = explode(" ",$Part);$browserver=$temp[2]; $browserver =preg_replace("/([d.]+)/","1",$browserver); $browserver = " $browserver"; $browser = "Internet Explorer"; } if ($browser!="") { $browseinfo = "$browser$browserver"; } else { $browseinfo = "Unknown"; } return $browseinfo; } //调用方法$browser=browseinfo() ;直接返回结果 ?>