随笔分类 -  php

无ssh通过php实现类型功能
该文被密码保护。

posted @ 2012-12-05 08:56 haven24 阅读(1) 评论(0) 推荐(0)

sublime text2好用的编辑器
摘要:下载连接:http://www.sublimetext.com/2 阅读全文

posted @ 2012-12-03 11:52 haven24 阅读(135) 评论(0) 推荐(0)

读取目录下文件名,存入一个文件
摘要:<?php $handler=opendir('images'); while(($imagename = readdir($handler)) !== false){ if($imagename!="."&&$imagename!=".."){ file_put_contents("images.txt",'http://'.$_SERVER['SERVER_NAME'].'/images/'.$imagename."\n",F 阅读全文

posted @ 2012-12-01 09:07 haven24 阅读(177) 评论(0) 推荐(0)

location.href
摘要:self.location.href="/url" 当前页面打开新页面,与默认的location.href 或者是windows.location.href 或者是 this.location.href 效果一样 parent.location.href="/url" 在父页面打开新页面 top.location.href="/url" 在顶层页面打开新页面 top.location.href="/url" 说的是在顶层页面打开url self.location.href="/url" 说的是仅 阅读全文

posted @ 2012-11-16 16:17 haven24 阅读(138) 评论(0) 推荐(0)

php file_exists 检查文件或目录是否存在(转载)
摘要:在我们一般正常情况下使用file_exists 检查文件或目录是否存在是没有问题了,但要注意一个是安全模式和目录没有执行权限的时就会返回false哦。我们先来看看关于file_exists的用法 file_exists() 函数检查文件或目录是否存在。 如果指定的文件或目录存在则返回 true,否则返回 false。 语法 file_exists(path)参数 描述 path 必需。规定要检查的路径。 例子 <?php echo file_exists("test.txt"); ?> 输出: 1 按这个原理 我在smarty模板开始工作如下 介绍 我发现了一个 阅读全文

posted @ 2012-10-24 14:33 haven24 阅读(12197) 评论(1) 推荐(1)

This function ereg_replace() has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged
摘要:碰到php升级到5.3.0后,function ereg_replace()被废除后的解决办法 $sefu = explode(",", ereg_replace( ' +', '', SEO_URLS_ONLY_IN ));改为:$sefu = explode(",", preg_replace( '/ +/', '', SEO_URLS_ONLY_IN )); 阅读全文

posted @ 2012-10-02 11:44 haven24 阅读(232) 评论(0) 推荐(0)

php实现301
摘要:$the_host = $_SERVER['HTTP_HOST'];//取得当前域名$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';//判断地址后面是否有参数 header('HTTP/1.1 301 Moved Permanently');//发出301头部header('Location: http://www.fkblog.org'.$request_uri);//跳转到目标 阅读全文

posted @ 2012-09-29 14:35 haven24 阅读(116) 评论(0) 推荐(0)

由于网站数据过大,导致内存不足。终于找到解决办法
摘要:解决办法:清空 seo_cache (TRUNCATE seo_cache)在/includes/classes/seo.install.php中的前面加入链接数据库代码如下:$server = 'localhost';$link = mysql_connect($server, 'haven', '');$result = mysql_select_db('haven')or die("haven database does not exist");$sql="TRUNCATE seo_cache& 阅读全文

posted @ 2011-08-07 14:07 haven24 阅读(434) 评论(0) 推荐(0)

判断size是否有效的代码
摘要:首先找到这段代码 /includes/classes/shopping_cart.php 中的($goto, $parameters) {}的zen_get_attributes_valid这个function,然再找zen_get_attributes_valid在哪个文件,通过grep 找到在/includes/functions/functions_lookups.php ,通过看代码发现f... 阅读全文

posted @ 2010-01-10 18:03 haven24 阅读(257) 评论(0) 推荐(0)

将products文件夹的所有图片分离出来
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<?php$server='localhost';$link=mysql_connect($server,'root','');$result=mysql_query('showdatabase... 阅读全文

posted @ 2009-12-07 10:45 haven24 阅读(356) 评论(0) 推荐(0)

通过程序来实现下载。。。最后的办法
摘要:<?phpini_set("max_execution_time",);$ftp_server = "192.168.1.1";$ftp_user = "haven";$ftp_pass = "haven";// set up a connection or die$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to ... 阅读全文

posted @ 2009-11-11 17:43 haven24 阅读(186) 评论(0) 推荐(0)

Linux自动备份压缩MySQL数据库的实用方法
摘要:<?php$server = 'localhost';$link = mysql_connect($server, 'root', 'haven');$result = mysql_query('show databases');echo '<pre>';while ($row = mysql_fetch_array($result)) {@mysql_select_db($ro... 阅读全文

posted @ 2009-10-15 17:24 haven24 阅读(2571) 评论(0) 推荐(0)

php 取小数点后面几位
摘要:string number_format ( float $number [, int $decimals ] )string number_format ( float $number , int $decimals , string $dec_point , string $thousands_sep )decimals :小数点后面2位dec_point :小数点用什么符号thousands... 阅读全文

posted @ 2009-10-09 10:53 haven24 阅读(8002) 评论(0) 推荐(0)

php debug
摘要:debug_print_backtrace();<?phperror_log($_SERVER['PHP_SELF'],3,'a.log');?><?phperror_log($_SERVER['PHP_SELF'],3,'a.log');?>error_reporting(E_ALL);ini_set("display_errors","1"); 阅读全文

posted @ 2009-09-30 18:36 haven24 阅读(181) 评论(0) 推荐(0)

zencart debug
摘要:application_top.php/*** set the level of error reporting* * Note STRICT_ERROR_REPORTING should never be set to true on a production site. <br />* It is mainly there to show php warnings during t... 阅读全文

posted @ 2009-09-04 11:13 haven24 阅读(229) 评论(0) 推荐(0)

导航