易截截图软件、单文件、免安装、纯绿色、仅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抓取alexa网页内容 提取站点统计信息

任务:根据输入的域名 统计以下三个数据,第一:全球排名;第二:用户量(月平均值);第三:
人均页面访问量(月平均值)。
思路:使用get_file_contents提取出网页内容,再根据正则表达式进行内容的筛选。
核心函数如下:
<?php
/*
 the function of getting aleax data
 @param string partten  ;the url set
 @return array partten ;
*/
 function get_alexa_data($url)
 {
  $a_url = explode(PHP_EOL,$url);
  
  $index = count($a_url);
  if(function_exists('file_get_contents'))
  {
   $result = array();
   $pattern = "|<div\\sclass=\"data[^\"]+?\">[^>]*?>[^>]*?([\\d,]+)\\s*?</div>[\\S\\s]*?id=\"reach[\\S\\s]*?<th>1".
"\\smonth[\\S\\s]*?class=\"avg.*?([\\d\\.]+)</td[\\S\\s]*?id=\"pageviews_per_user\"[\\S\\s]*?".
"1\\smonth[\\S\\s]*?class=\"avg.*?([\\d\\.]+)</td|";
   
   for($i = 0; $i < $index; $i++)
   ......

Redhat下 Apache, php, mysql的默认安装路径

apache:
如果采用RPM包安装,安装路径应在 /etc/httpd目录下
apache配置文件:/etc/httpd/conf/httpd.conf
Apache模块路径:/usr/sbin/apachectl
web目录:/var/www/html
如果采用源代码安装,一般默认安装在/usr/local/apache2目录下
php:
如果采用RPM包安装,安装路径应在 /etc/目录下
php的配置文件:/etc/php.ini
如果采用源代码安装,一般默认安装在/usr/local/lib目录下
php配置文件: /usr/local/lib/php.ini
或/usr/local/php/etc/php.ini 
mysql:
如果采用RPM包安装,安装路径应在/usr/share/mysql目录下
mysqldump文件位置:/usr/bin/mysqldump
mysqli配置文件:
/etc/my.cnf或/usr/share/mysql/my.cnf
mysql数据目录在/var/lib/mysql目录下
如果采用源代码安装,一般默认安装在/usr/local/mysql目录下 ......

Redhat下 Apache, php, mysql的默认安装路径

apache:
如果采用RPM包安装,安装路径应在 /etc/httpd目录下
apache配置文件:/etc/httpd/conf/httpd.conf
Apache模块路径:/usr/sbin/apachectl
web目录:/var/www/html
如果采用源代码安装,一般默认安装在/usr/local/apache2目录下
php:
如果采用RPM包安装,安装路径应在 /etc/目录下
php的配置文件:/etc/php.ini
如果采用源代码安装,一般默认安装在/usr/local/lib目录下
php配置文件: /usr/local/lib/php.ini
或/usr/local/php/etc/php.ini 
mysql:
如果采用RPM包安装,安装路径应在/usr/share/mysql目录下
mysqldump文件位置:/usr/bin/mysqldump
mysqli配置文件:
/etc/my.cnf或/usr/share/mysql/my.cnf
mysql数据目录在/var/lib/mysql目录下
如果采用源代码安装,一般默认安装在/usr/local/mysql目录下 ......

php中使用header函数的http头设置

/ ok
header('HTTP/1.1 200 OK');
//设置一个404头:
header('HTTP/1.1 404 Not Found');
//设置地址被永久的重定向
header('HTTP/1.1 301 Moved Permanently');
//转到一个新地址
header('Location: http://www.example.org/'
);
//文件延迟转向:
header('Refresh: 10; url=http://www.example.org/');
print 'You will be redirected in 10 seconds';
//当然,也可以使用html语法实现
// <meta http-equiv="refresh" content="10;http://www.example.org/ />
// override X-Powered-By: PHP:
header('X-Powered-By: PHP/4.4.0');
header('X-Powered-By: Brain/0.6b');
//文档语言
header('Content-language: en');
//告诉浏览器最后一次修改时间
$time = time() - 60; // or filemtime($fn), etc
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');
//告诉浏览器文档内容没有发生改变
header('HTTP/1.1 304 Not Modified');
//设置内容长度
header('Content-Length: 1234');
//设置为一个下载类型
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename ......

nginx + php + https 配置用例

#
启动服务的用户和组
user
lighttpd lighttpd;
#
开多少进程
worker_processes
2;
#
错误日志
error_log
/data/log/nginx/nginx_error/nginx_error.log crit;
#
pid
pid
        /var/run/nginx.pid;
#
Specifies
the value for maximum file descriptors that can be opened by this
process.
worker_rlimit_nofile
51200;
events
{
    use
epoll;
   
worker_connections
51200;
}
http
{
    #
开两 php-cgi 服务,端口连接方式速度快,socket方式稳定
   
#
使用
lighttpd 的 spawn-fcgi 起的fast-cgi
    #
weight
是设置权重
    upstream phpfastcgi
{
        server

unix:/tmp/php-fastcgi0.sock weight=1;
        server
unix:/tmp/php-fastcgi1.sock weight=1;
        #

server 127.0.0.1:8000  
weight=1;
 &nbs ......

php验证码显示红色叉叉

php验证码显示红色叉叉
这个问题困扰我半天了。在本机上测试是正常的,环境是win2003+php+mssql.显示正常。
现在我把程序转移到新服务器上,验证码就不显示了,不知道是什么情况,我检测了服务器环境,gd是支持的,如下图:
但是,就是不显示,如有高手,请跟帖,谢谢了。 ......

PHP写的MD5破解与加密程序

程序代码
<!--p
  if(isset($_POST['md5'])){ //判断$md5是否已设置,如果设置了则执行以下代码。
  if(!is_numeric($_POST['time'])){ //如果没获取到time的值则将time的值设置为30
    $_POST['time'] = 30;
      }
    set_time_limit($_POST['time']); //设置页面最长执行时间为$time
  if(strlen($_POST['md5']) == 32){  //判断$md5的长度是否为32位
    if($_POST['lx'] == "shuzi"){ //判断$lx的值是否为shuzi
    $i = 0;
//$md5不等于MD5加密后的$i且$i不等于99999999则继续执行$i++
  while($_POST['md5'] != md5($i) &#038;& $i != 99999999){
    $i++;
    }
      }
    else
    {
//$i起始值为a循环md5($i)如果等于$md5则跳出一直到$i不等于zzzzzzzz
    for($i = "a"; $i != "zzzzzzzz"; $i++){
    if(md5($i) == $_POST['md5']){
    break;
    ......
总记录数:2174; 总页数:363; 每页6 条; 首页 上一页 [1] 2 [3] [4] [5] [6] [7] [8] [9] [10]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号