<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>phpsir的博客</title>
	<atom:link href="http://www.phpsir.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phpsir.com</link>
	<description>注意听客户叙述, 发散的联想能力, 总结</description>
	<lastBuildDate>Fri, 18 May 2012 02:05:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>手机号码js正则</title>
		<link>http://www.phpsir.com/%e6%89%8b%e6%9c%ba%e5%8f%b7%e7%a0%81js%e6%ad%a3%e5%88%99.html</link>
		<comments>http://www.phpsir.com/%e6%89%8b%e6%9c%ba%e5%8f%b7%e7%a0%81js%e6%ad%a3%e5%88%99.html#comments</comments>
		<pubDate>Fri, 18 May 2012 02:05:44 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[经验随笔]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[手机号码]]></category>
		<category><![CDATA[正则]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=428</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.phpsir.com/wp-content/uploads/2012/05/手机号码js正则.png"><img class="alignnone size-full wp-image-429" title="手机号码js正则" src="http://www.phpsir.com/wp-content/uploads/2012/05/手机号码js正则.png" alt="" width="496" height="44" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/%e6%89%8b%e6%9c%ba%e5%8f%b7%e7%a0%81js%e6%ad%a3%e5%88%99.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ecshop 在转换 shopex 4.8 的过程中的错误</title>
		<link>http://www.phpsir.com/shopex-convert-to-ecshop-4-8-5.html</link>
		<comments>http://www.phpsir.com/shopex-convert-to-ecshop-4-8-5.html#comments</comments>
		<pubDate>Thu, 03 May 2012 05:16:40 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[PHP杂症]]></category>
		<category><![CDATA[4.8.5]]></category>
		<category><![CDATA[ecshop]]></category>
		<category><![CDATA[shopex]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=418</guid>
		<description><![CDATA[在ecshop的转换程序中，绝大部分都ok,只有一点小的错误 1) 要求 shopex 的 images存在 link 目录，好，那就建立之 2) process_goods() 函数里面错误的处理了所有的商品相册 /* 商品相册 */ $sql2 = "SELECT * FROM ".$this-&#62;sprefix."gimages"; 修改为 $sql2 = "SELECT * FROM ".$this-&#62;sprefix."gimages where goods_id = '".$row['goods_id']."'"; 就可以完美支持到 4.8.5的shopex的 转换 另外因为复制文件过程比较慢，特别是对于商品多的站点，那么可以在再次运行转换程序时候可以屏蔽掉 一些过程 比如 function process_file(),可以简单的返回 return &#8230; <a href="http://www.phpsir.com/shopex-convert-to-ecshop-4-8-5.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>在ecshop的转换程序中，绝大部分都ok,只有一点小的错误<br />
1) 要求 shopex 的 images存在 link 目录，好，那就建立之<br />
2) process_goods() 函数里面错误的处理了所有的商品相册</p>
<pre class="brush:php">        /* 商品相册 */
            $sql2 = "SELECT * FROM ".$this-&gt;sprefix."gimages";
修改为
             $sql2 = "SELECT * FROM ".$this-&gt;sprefix."gimages where goods_id = '".$row['goods_id']."'";</pre>
<p>就可以完美支持到 4.8.5的shopex的 转换</p>
<p>另外因为复制文件过程比较慢，特别是对于商品多的站点，那么可以在再次运行转换程序时候可以屏蔽掉 一些过程<br />
比如 function process_file(),可以简单的返回 return true; 就好</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/shopex-convert-to-ecshop-4-8-5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ecshop insert_goods_sells 的勘误</title>
		<link>http://www.phpsir.com/ecshop-insert-goods-sells.html</link>
		<comments>http://www.phpsir.com/ecshop-insert-goods-sells.html#comments</comments>
		<pubDate>Sat, 28 Apr 2012 10:57:19 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[PHP杂症]]></category>
		<category><![CDATA[ecshop]]></category>
		<category><![CDATA[lib_insert]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=415</guid>
		<description><![CDATA[看到 http://www.ecshop120.com/ecshop-mobanxiugai/article-19.html 这篇文章里面的 {insert name=&#8217;goods_sells&#8217; goods_id=$id} 发下里面的部分情可能在有些模板里面会错，要根据当前的环境改写成如下 {insert name=&#8217;goods_sells&#8217; goods_id=$goods.goods_id}]]></description>
			<content:encoded><![CDATA[<p>看到  http://www.ecshop120.com/ecshop-mobanxiugai/article-19.html<br />
这篇文章里面的</p>
<p>{insert name=&#8217;goods_sells&#8217; goods_id=$id}</p>
<p>发下里面的部分情可能在有些模板里面会错，要根据当前的环境改写成如下</p>
<p>{insert name=&#8217;goods_sells&#8217; goods_id=$goods.goods_id}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/ecshop-insert-goods-sells.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>winrar 的功能</title>
		<link>http://www.phpsir.com/winrar-sel.html</link>
		<comments>http://www.phpsir.com/winrar-sel.html#comments</comments>
		<pubDate>Wed, 25 Apr 2012 12:43:44 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[经验随笔]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=412</guid>
		<description><![CDATA[C:\Program Files\WinRAR\WinRAR a -sfx -iiconc:\windows\SystemTray.ico c:\1.exe c:\vip C:\Program Files\WinRAR\rar c -zc:\1.txt c:\1.exe 1.txt Path=%windir%\xiaoyu SavePath Setup=%windir%\xiaoyu\vip\主控.exe Silent=1 Overwrite=1]]></description>
			<content:encoded><![CDATA[<p>C:\Program Files\WinRAR\WinRAR a -sfx -iiconc:\windows\SystemTray.ico c:\1.exe c:\vip</p>
<p>C:\Program Files\WinRAR\rar c -zc:\1.txt c:\1.exe</p>
<p>1.txt </p>
<p>Path=%windir%\xiaoyu<br />
SavePath<br />
Setup=%windir%\xiaoyu\vip\主控.exe<br />
Silent=1<br />
Overwrite=1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/winrar-sel.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ecshop 的 fckeditor 插件在韩文系统下的显示问题</title>
		<link>http://www.phpsir.com/ecshop-fckeditor.html</link>
		<comments>http://www.phpsir.com/ecshop-fckeditor.html#comments</comments>
		<pubDate>Sat, 21 Apr 2012 06:02:43 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[PHP杂症]]></category>
		<category><![CDATA[ecshop]]></category>
		<category><![CDATA[fckeditor]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=406</guid>
		<description><![CDATA[一朋友韩文XP 系统，装utf8版本的 ecshop 总是出错， 我查看后发现并无错误，只不过是在朋友系统里面错了 才知道，fckeditor 有自动探测客户端的能力， 修改一处代码修复 FCKConfig.AutoDetectLanguage = false ;]]></description>
			<content:encoded><![CDATA[<p>一朋友韩文XP 系统，装utf8版本的 ecshop 总是出错，<br />
我查看后发现并无错误，只不过是在朋友系统里面错了<br />
才知道，fckeditor 有自动探测客户端的能力，<br />
修改一处代码修复</p>
<pre class="brush:as3">FCKConfig.AutoDetectLanguage = false ;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/ecshop-fckeditor.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>支付宝快捷登陆ecshop错误勘误</title>
		<link>http://www.phpsir.com/alipay-fastlogin-ecshop-openid.html</link>
		<comments>http://www.phpsir.com/alipay-fastlogin-ecshop-openid.html#comments</comments>
		<pubDate>Sat, 21 Apr 2012 05:40:07 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[经验随笔]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=402</guid>
		<description><![CDATA[朋友反应 支付宝快捷登陆不好用 检查发现 是因为 openid.php 里面保存 alipay_id 的部分错误的使用了intval函数 结果导致alipay_id 发生了缩短变化 , 删除掉 intval 函数后程序运行正常 $alipay_id = empty($_POST['alipay_id']) ? '' : $_POST['alipay_id'] ;]]></description>
			<content:encoded><![CDATA[<p>朋友反应 支付宝快捷登陆不好用<br />
检查发现 是因为 openid.php 里面保存 alipay_id 的部分错误的使用了intval函数<br />
结果导致alipay_id 发生了缩短变化 , 删除掉 intval 函数后程序运行正常</p>
<pre class="brush:php">$alipay_id = empty($_POST['alipay_id']) ? '' : $_POST['alipay_id'] ;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/alipay-fastlogin-ecshop-openid.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>同一paypal 在多个ecshop站点使用代码修改</title>
		<link>http://www.phpsir.com/paypal-using-in-multi-ecshop.html</link>
		<comments>http://www.phpsir.com/paypal-using-in-multi-ecshop.html#comments</comments>
		<pubDate>Wed, 18 Apr 2012 00:31:23 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[PHP杂症]]></category>
		<category><![CDATA[ecshop]]></category>
		<category><![CDATA[paypal]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=399</guid>
		<description><![CDATA[症状: 同一个paypal账号在多个ecshop 站点使用，出现paypal订单已经支付从而无法支付的状况 includes\modules\payment\paypal.php 修改 function get_code($order, $payment) 函数内 $data_order_id = $order['log_id']; 改为 $data_order_id = 'site2'. $order['log_id']; 修改 function respond() 函数内 $order_sn = substr($_POST['invoice'],5); // 5 是 'site2' 这5个字符的长度，要根据这个修改]]></description>
			<content:encoded><![CDATA[<p>症状: 同一个paypal账号在多个ecshop 站点使用，出现paypal订单已经支付从而无法支付的状况</p>
<pre class="brush:php">includes\modules\payment\paypal.php

修改 function get_code($order, $payment) 函数内

$data_order_id = $order['log_id'];
改为
$data_order_id = 'site2'. $order['log_id'];
修改 function respond() 函数内
$order_sn = substr($_POST['invoice'],5); // 5 是 'site2' 这5个字符的长度，要根据这个修改</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/paypal-using-in-multi-ecshop.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ecshop可多次使用的红包功能</title>
		<link>http://www.phpsir.com/ecshop-bonus-multi-use.html</link>
		<comments>http://www.phpsir.com/ecshop-bonus-multi-use.html#comments</comments>
		<pubDate>Thu, 12 Apr 2012 00:58:42 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[PHP杂症]]></category>
		<category><![CDATA[ecshop 红包 多次]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=394</guid>
		<description><![CDATA[ecshop 添加可多次使用的红包步骤 1) 添加一种新的红包类型4 ， 文件 admin/templates/bonus_type_info.htm 找到 &#60;input type="radio" name="send_type" value="0" {if $bonus_arr.send_type eq 0} checked="true" {/if} onClick="showunit(0)" /&#62;{$lang.send_by[0]} &#60;input type="radio" name="send_type" value="1" {if $bonus_arr.send_type eq 1} checked="true" {/if} onClick="showunit(1)" /&#62;{$lang.send_by[1]} &#60;input type="radio" name="send_type" value="2" {if $bonus_arr.send_type eq 2} &#8230; <a href="http://www.phpsir.com/ecshop-bonus-multi-use.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<pre class="brush:php">ecshop 添加可多次使用的红包步骤
1) 添加一种新的红包类型4 ，
文件 admin/templates/bonus_type_info.htm
找到  &lt;input type="radio" name="send_type" value="0" {if $bonus_arr.send_type eq 0} checked="true" {/if} onClick="showunit(0)"  /&gt;{$lang.send_by[0]}
      &lt;input type="radio" name="send_type" value="1" {if $bonus_arr.send_type eq 1} checked="true" {/if} onClick="showunit(1)"  /&gt;{$lang.send_by[1]}
      &lt;input type="radio" name="send_type" value="2" {if $bonus_arr.send_type eq 2} checked="true" {/if} onClick="showunit(2)"  /&gt;{$lang.send_by[2]}
      &lt;input type="radio" name="send_type" value="3" {if $bonus_arr.send_type eq 3} checked="true" {/if} onClick="showunit(3)"  /&gt;{$lang.send_by[3]}
      再其后面添加
&lt;input type="radio" name="send_type" value="4" {if $bonus_arr.send_type eq 4} checked="true" {/if} onClick="showunit(4)"  /&gt;通用红包 多次使用

2) 生成这类红包字符串
增加文件 admin/templates/bonus_by_print_phpsir.htm
修改文件 admin/bonus.php 找到
 elseif ($_REQUEST['send_by'] == SEND_BY_PRINT)
    {
        $smarty-&gt;assign('type_list',    get_bonus_type());

        $smarty-&gt;display('bonus_by_print.htm');
    }

    再其后添加
     elseif ($_REQUEST['send_by'] == 4)
    {
        $smarty-&gt;assign('type_list',    get_bonus_type_phpsir());

        $smarty-&gt;display('bonus_by_print_phpsir.htm');
    }

3) 增加 get_bonus_type_phpsir 函数
文件 admin/includes/lib_main.php

function get_bonus_type_phpsir()
{
    $bonus = array();
    $sql = 'SELECT type_id, type_name, type_money FROM ' . $GLOBALS['ecs']-&gt;table('bonus_type') .
           ' WHERE send_type = 4';
    $res = $GLOBALS['db']-&gt;query($sql);

    while ($row = $GLOBALS['db']-&gt;fetchRow($res))
    {
        $bonus[$row['type_id']] = $row['type_name'].' [' .sprintf($GLOBALS['_CFG']['currency_format'], $row['type_money']).']';
    }

    return $bonus;
}

4) 在 bonus.php 里面 找到
if ($_REQUEST['act'] == 'send_by_print')
{
...........................
}
再其后面添加，处理增加这类红包时候生成方法

if ($_REQUEST['act'] == 'send_by_print_phpsir')
{
    @set_time_limit(0);

    /* 红下红包的类型ID和生成的数量的处理 */
    $bonus_typeid = !empty($_POST['bonus_type_id']) ? $_POST['bonus_type_id'] : 0;
    $bonus_sum    = !empty($_POST['bonus_sum'])     ? $_POST['bonus_sum']     : 1;

    /* 生成红包序列号 */

    for ($i = 0, $j = 0; $i &lt; $bonus_sum; $i++)
    {
        $bonus_sn = $_POST['bonus_txt'];
        $db-&gt;query("INSERT INTO ".$ecs-&gt;table('user_bonus')." (bonus_type_id, bonus_sn) VALUES('$bonus_typeid', '$bonus_sn')");

        $j++;
    }

    /* 记录管理员操作 */
    admin_log($bonus_sn, 'add', 'userbonus');

    /* 清除缓存 */
    clear_cache_files();

    /* 提示信息 */
    $link[0]['text'] = $_LANG['back_bonus_list'];
    $link[0]['href'] = 'bonus.php?act=bonus_list&amp;bonus_type=' . $bonus_typeid;

    sys_msg($_LANG['creat_bonus'] . $j . $_LANG['creat_bonus_num'], 0, $link);
}

5) 修改 bonus.php 让后台显示红包内容
if ($_REQUEST['act'] == 'bonus_list')
{
...........................
}
和
if ($_REQUEST['act'] == 'query_bonus')
{
...........................
}
里面增加
 if ($bonus_type['send_type'] == 4)
    {
        $smarty-&gt;assign('show_bonus_sn', 1);
    }

至此 后台部分完成

前台部分 修改
includes/lib_order.php

function bonus_info($bonus_id, $bonus_sn = '')
{
    $sql = "SELECT t.*, b.* " .
            "FROM " . $GLOBALS['ecs']-&gt;table('bonus_type') . " AS t," .
                $GLOBALS['ecs']-&gt;table('user_bonus') . " AS b " .
            "WHERE t.type_id = b.bonus_type_id    ";

    if ($bonus_id &gt; 0)
    {
        $sql .= " AND b.bonus_id = '$bonus_id'";
        $row = $GLOBALS['db']-&gt;getRow($sql);
        return $row;
    }
    else
    {
        $sql .= " AND b.bonus_sn = '$bonus_sn'";
        $row = $GLOBALS['db']-&gt;getRow($sql);
    }

    if($row['send_type'] == 4) // phpsir 如果是第4类型红包，那么就找一个未使用的红包,这种红包可被多次使用，不限制每人使用次数
    {
        $sess_userid = $_SESSION["user_id"];
        $sql = "SELECT t.*, b.* " .
                "FROM " . $GLOBALS['ecs']-&gt;table('bonus_type') . " AS t," .
                    $GLOBALS['ecs']-&gt;table('user_bonus') . " AS b " .
                "WHERE t.type_id = b.bonus_type_id  and b.used_time = 0  ";
        if ($bonus_id &gt; 0)
        {
            $sql .= "AND b.bonus_id = '$bonus_id'";
        }
        else
        {
            $sql .= "AND b.bonus_sn = '$bonus_sn'";
        }
//print $sql;

        $row = $GLOBALS['db']-&gt;getRow($sql);
        //var_dump($row);
        return $row;

    }

// 如果想每人只使用N次，请用下面的部分
/*
  if($row['send_type'] == 4) // phpsir 如果是第4类型红包，那么就找一个未使用的红包,这种红包可被多次使用，不限制每人使用次数
    {
        $sess_userid = $_SESSION["user_id"];
        $sql = "SELECT t.*, b.* " .
                "FROM " . $GLOBALS['ecs']-&gt;table('bonus_type') . " AS t," .
                    $GLOBALS['ecs']-&gt;table('user_bonus') . " AS b " .
                "WHERE t.type_id = b.bonus_type_id  and b.user_id = '$sess_userid'   and  b.bonus_sn = '$bonus_sn' ";
        $rows = $GLOBALS['db']-&gt;getAll($sql);
        $allow_used_bonus_num = 2; // 最大允许使用次数
        if(count($rows) &gt;= $allow_used_bonus_num )
        {
            return false;
        }else{
            $sql = "SELECT t.*, b.* " .
                    "FROM " . $GLOBALS['ecs']-&gt;table('bonus_type') . " AS t," .
                        $GLOBALS['ecs']-&gt;table('user_bonus') . " AS b " .
                    "WHERE t.type_id = b.bonus_type_id  and b.used_time = 0   and  b.bonus_sn = '$bonus_sn' ";
            $row = $GLOBALS['db']-&gt;getRow($sql);
            return $row;
        }

    }

*/ 

    return $row;

}</pre>
<p><a href="devtxt/bonus.txt">红包txt</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/ecshop-bonus-multi-use.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ecshop 批量传相册 swfupload 插件</title>
		<link>http://www.phpsir.com/ecshop-batch-swfupload-gallery.html</link>
		<comments>http://www.phpsir.com/ecshop-batch-swfupload-gallery.html#comments</comments>
		<pubDate>Thu, 05 Apr 2012 05:35:42 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[PHP杂症]]></category>
		<category><![CDATA[经验随笔]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=379</guid>
		<description><![CDATA[ecshop 相册不是太方便，可以用如下swfupload 批量上传 需要修改  admin/includes/lib_goods.php 的 handle_gallery_image 函数 另外修改下 admin/templates/goods_info.htm 加个到批量的链接 然后下载本插件，本插件为有偿差价，价格 100，可以联系QQ 733905 得到 视频地址 截屏如下 &#160; &#160; &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>ecshop 相册不是太方便，可以用如下swfupload 批量上传</p>
<p>需要修改  admin/includes/lib_goods.php 的 handle_gallery_image 函数<br />
另外修改下 admin/templates/goods_info.htm 加个到批量的链接</p>
<p>然后下载本插件，本插件为有偿差价，价格 100，可以联系QQ 733905 得到</p>
<p>视频地址</p>
<p><embed src="http://player.youku.com/player.php/sid/XMzc2ODg0OTM2/v.swf" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed></p>
<p>截屏如下</p>
<p>&nbsp;</p>
<p><a href="http://www.phpsir.com/wp-content/uploads/2012/04/batchuploadswf.png"><img class="alignnone size-full wp-image-381" title="batchuploadswf" src="http://www.phpsir.com/wp-content/uploads/2012/04/batchuploadswf.png" alt="" width="437" height="175" /></a></p>
<p><a href="http://www.phpsir.com/wp-content/uploads/2012/04/batuploadswf2.png"><img class="alignnone size-full wp-image-380" title="batuploadswf2" src="http://www.phpsir.com/wp-content/uploads/2012/04/batuploadswf2.png" alt="" width="565" height="213" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/ecshop-batch-swfupload-gallery.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ecshop 后台登陆自动退出的一种可能情况，目录大小写，win 注意了</title>
		<link>http://www.phpsir.com/ecshop-auto-logout.html</link>
		<comments>http://www.phpsir.com/ecshop-auto-logout.html#comments</comments>
		<pubDate>Wed, 07 Mar 2012 00:53:26 +0000</pubDate>
		<dc:creator>phpsir</dc:creator>
				<category><![CDATA[PHP杂症]]></category>
		<category><![CDATA[ecshop]]></category>

		<guid isPermaLink="false">http://www.phpsir.com/?p=370</guid>
		<description><![CDATA[问题描述: 某客户的ecshop后台登陆后，显示成功，但是自动退出到登陆界面。 问题解决: 因为 windows 系统不区分目录大小写，而php是区分大小写的 那么 http://你的域名/admin/ 和 http://你的域名/Admin/ 就不一样 如果你用后者登陆系统，就会出现自动退出的情况 具体原因在 admin/includes/init.php 里面代码决定, 要求是 data/config.php 里面的 ADMIN_PATH 必须严格和你的登陆地址一致，包括大小写！！！ &#160; if ($_REQUEST['act'] != 'login' &#38;&#38; $_REQUEST['act'] != 'signin' &#38;&#38; $_REQUEST['act'] != 'forget_pwd' &#38;&#38; $_REQUEST['act'] != 'reset_pwd' &#38;&#38; $_REQUEST['act'] != &#8230; <a href="http://www.phpsir.com/ecshop-auto-logout.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>问题描述:<br />
某客户的ecshop后台登陆后，显示成功，但是自动退出到登陆界面。<br />
问题解决:<br />
因为 windows 系统不区分目录大小写，而php是区分大小写的<br />
那么 http://你的域名/admin/ 和 http://你的域名/Admin/ 就不一样</p>
<p>如果你用后者登陆系统，就会出现自动退出的情况<br />
具体原因在 admin/includes/init.php 里面代码决定,</p>
<p>要求是 data/config.php 里面的 ADMIN_PATH 必须严格和你的登陆地址一致，包括大小写！！！</p>
<p>&nbsp;</p>
<pre class="brush:php">if ($_REQUEST['act'] != 'login' &amp;&amp; $_REQUEST['act'] != 'signin' &amp;&amp;
    $_REQUEST['act'] != 'forget_pwd' &amp;&amp; $_REQUEST['act'] != 'reset_pwd' &amp;&amp; $_REQUEST['act'] != 'check_order')
{
    $admin_path = preg_replace('/:\d+/', '', $ecs-&gt;url()) . ADMIN_PATH;
    if (!empty($_SERVER['HTTP_REFERER']) &amp;&amp;
        strpos(preg_replace('/:\d+/', '', $_SERVER['HTTP_REFERER']), $admin_path) === false)
    {
        if (!empty($_REQUEST['is_ajax']))
        {
            make_json_error($_LANG['priv_error']);
        }
        else
        {
            ecs_header("Location: privilege.php?act=login\n");
        }

        exit;
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.phpsir.com/ecshop-auto-logout.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

