易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 : php

PHP配置MYSQL

这两天在捣鼓PHP,去ecshop和phpwind下载了一个商城和一个论坛。两个都需要安装mysql的服务器,于是我按照教程进行安装。结果发现每次都是到连接数据库的地方就变成空白页了。死活找不出来问题。后来在余建的指导下,发现原来是PHP的版本过高。真是郁闷。
现在我把我最近配置的过程写出来。
所需软件:
apache_2.2.14-win32-x86-no_ssl.msi
ZendOptimizer-3.3.0a-Windows-i386.zip
php-5.2.12-Win32.zip(我用的是5.3的,所以一直配置不成功,用这个版本的一次成功。搞不清楚啥问题。)
mysql-essential-5.1.40-win32.zip
PHPWind_GBK_7.5.zip
ECShop_V2.7.1_GBK_Release1228.zip
安装步骤:
一、安装apach
二、解压缩php5.2.12
三、安装ZendOptimizer
四、配置apache可以访问两个网站。配置httpd.conf可以解析页面中php代码
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .html
    AddType application/x-httpd-php .htm
五、配置apache的httpd.conf,用来加载解析php所需要的模块
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "C:/PHP/php"
Load ......

php 模式修正符

模式修正符 — 解说正则表达式模式中使用的修正符
说明
下面列出了当前在 PCRE 中可能使用的修正符。括号中是这些修正符的内部 PCRE 名。修正符中的空格和换行被忽略,其它字符会导致错误。
 
i (PCRE_CASELESS) 如果设定此修正符,模式中的字符将同时匹配大小写字母。 m(PCRE_MULTILINE) 默认情况下,PCRE 将目标字符串作为单一的一“行”字符所组成的(甚至其中包含有换行符也是如此)。“行起始”元字符(^)仅仅匹配字符串的起始,“行结束”元字符($)仅仅匹配字符串的结束,或者最后一个字符是换行符时其前面(除非设定了 D 修正符)。这和 Perl 是一样的。 当设定了此修正符,“行起始”和“行结束”除了匹配整个字符串开头和结束外,还分别匹配其中的换行符的之后和之前。这和 Perl 的 /m 修正符是等效的。如果目标字符串中没有“\n”字符或者模式中没有 ^ 或 $,则设定此修正符没有任何效果。 s(PCRE_DOTALL) 如果设定了此修正符,模式中的圆点元字符(.)匹配所有的字符,包括换行符。没有此设定的话,则不包括换行符。这和 Perl 的 /s 修正符是等效的。排除字符类例如 [^a] 总是 ......

PHP 面试题及答案

简述题(50分)()
1、用PHP打印出前一天的时间格式是2006-5-10 22:21:21(2分)
echo date('Y-m-d H:i:s', strtotime('-1 day'));
或者
$yesterday = time() - (24 * 60 * 60);
echo 'today:'.date('Y-m-d H:i:s')."\n";
echo 'yesterday:'. date('Y-m-d H:i:s', $yesterday)."\n";
2、echo(),print(),print_r()的区别(3分)
echo是PHP语句, print和print_r是函数,语句没有返回值,函数可以有返回值(即便没有用)
print只能打印出简单类型变量的值(如int,string)
print_r可以打印出复杂类型变量的值(如数组,对象)
echo -- 输出一个或者多个字符串
3、能够使HTML和PHP分离开使用的模板(1分)
smarty,Heyes Template Class等
5、使用哪些工具进行版本控制?(1分)
CVS和SVN,SVN号称下一代CVS,功能强大,不过CVS是老牌,市占率很高.我一直用SVN,题目是问用什么工具呃,这个可能需要这么回答:CVS Server on Apache作服务端,WinCVS作客户端;Subversion on Apache/DAV 做服务端,TortoiseSVN做客户端,或者Subclipse做客户端.
6、如何实现字符串翻转?(3分)
strrev()
或者
$str = "abcdefg";
function strrevv($str)
{
$len=strlen($str);
$newstr = '';
for($i=$le ......

PHP中的MYSQL常用函数总结

PHP中的MYSQL常用函数总结
1、mysql_connect()-建立数据库连接
格式:
    resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
例:
    $conn = @mysql_connect("localhost", "username", "password") or dir("不能连接到Mysql Server");
说明:使用该连接必须显示的关闭连接
2、mysql_pconnect()-建立数据库连接
格式:
    resource mysql_pconnect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
例:
    $conn = @mysql_pconnect("localhost", "username", "password") or dir("不能连接到Mysql Server");
说明:使用该连接函数不需要显示的关闭连接,它相当于使用了连接池
3、mysql_close()-关闭数据库连接
例:
    $conn = @mysql_connect("localhost", "username", "password") or die("不能连接到Mysql Server");
    @mysql_select_db("MyDatabase") or die("不能选择这个数据库,或数据库不存在");
 & ......

PHP中的MYSQL常用函数总结

PHP中的MYSQL常用函数总结
1、mysql_connect()-建立数据库连接
格式:
    resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
例:
    $conn = @mysql_connect("localhost", "username", "password") or dir("不能连接到Mysql Server");
说明:使用该连接必须显示的关闭连接
2、mysql_pconnect()-建立数据库连接
格式:
    resource mysql_pconnect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
例:
    $conn = @mysql_pconnect("localhost", "username", "password") or dir("不能连接到Mysql Server");
说明:使用该连接函数不需要显示的关闭连接,它相当于使用了连接池
3、mysql_close()-关闭数据库连接
例:
    $conn = @mysql_connect("localhost", "username", "password") or die("不能连接到Mysql Server");
    @mysql_select_db("MyDatabase") or die("不能选择这个数据库,或数据库不存在");
 & ......

php表达式之explode() 分割字符串

原帖地址:http://www.phpma.com/english/20071215/640.html
Description
array explode
( string separator, string string [, int limit])phpma.com
Returns an array of strings, each of which is a substring of string
formed by splitting it on boundaries formed by the string separator
. If limit
is set, the returned array will contain a maximum of limit
elements with the last element containing the rest of string
.
If separator
is an empty string (""), explode()
will return FALSE
. If separator
contains a value that is not contained in string
, then explode()
will return an array containing string
.
If the limit
parameter is negative, all components except the last limit
are returned. This feature was added in PHP
5.1.0
.
Although implode()
can, for historical reasons, accept its parameters in either order, explode()
cannot. You must ensure that the separator
argument comes before the string
argument.
注:
The limit
parameter was added ......

[测试]:仿网易V交友PHP版

测试:http://www.yincode.com
用户:test1 test2 test3
密码:123456
=======================================
2010/01/12/18:54:24
=======================================
谷歌浏览器浏览不正常
main.js
function getData(u,m,callBack){
   var ru=u+"&r="+Math.random();
   $("loading").style.display="";
   new Ajax.Request(ru,{  
      method:m,
   encoding:"GBK",
   onSuccess:callBack,
   onComplete:function(){
          $("loading").style.display="none";
   },
   onFailure:function(){
         alert("请求出错了!");
   }
   });
}
Request 无法调用函数 ......
总记录数:2174; 总页数:363; 每页6 条; 首页 上一页 [197] [198] [199] [200] 201 [202] [203] [204] [205] [206]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号