参见地址
http://paypal.ebay.cn/integrationcenter/list__resource_2.html
启用IPN有两种方法:
一种是在您的PayPal账户里进行全局设置
另一种是在每笔交易的付款按钮中通过定义变量notify_url来进行设定
参见地址
http://paypal.ebay.cn/integrationcenter/list__resource_2.html
启用IPN有两种方法:
一种是在您的PayPal账户里进行全局设置
另一种是在每笔交易的付款按钮中通过定义变量notify_url来进行设定
在ecshop的会员整合ucenter的set_cookie函数有问题
文件在 /api/uc.php 搜索 set_cookie
function set_cookie($user_id=”, $user_name = ”, $email = ”)
{
if (empty($user_id))
{
/* 摧毁cookie */
$time = time() – 3600;
setcookie(‘ECS[user_id]’, ”, $time);//这里有问题
setcookie(‘ECS[username]’, ”, $time);//这里有问题
setcookie(‘ECS[email]’, ”, $time);//这里有问题
}
else
{
/* 设置cookie */
$time = time() + 3600 * 24 * 30;
setcookie(“ECS[user_id]”, $user_id, $time, $GLOBALS[‘cookie_path’], $GLOBALS[‘cookie_domain’]);
setcookie(“ECS[username]”, $user_name, $time, $GLOBALS[‘cookie_path’], $GLOBALS[‘cookie_domain’]);
setcookie(“ECS[email]”, $email, $time, $GLOBALS[‘cookie_path’], $GLOBALS[‘cookie_domain’]);
}
}
因为假设这样的架构
http://域名/ 是 ecshop ,http://域名/bbs/ 为论坛dzX2, 那么,在ec登陆后,dzX2 点退出,
会发送一个javascript申请到 /api/uc.php的 logout请求 ( 如果setcookie 只是在 /api/ 下 设置cookie 为空,那么就清空不了cookie
严格的应该是
setcookie(‘ECS[user_id]’, ”, $time,$GLOBALS[‘cookie_path’], $GLOBALS[‘cookie_domain’]);
还有要修改ecshop的 ucenter插件,includes/modules/integrates/ucenter.php
如图两部分
另外还要看 这一篇
/ucenter-sync.html
http://www.w3.org/International/questions/qa-utf8-bom
./configure –with-gd –with-jpeg-dir=/usr/lib
这个居然不起作用
那么起作用的是
./configure –with-jpeg-dir=/usr/lib –with-gd
在此谨记!
file_put_contents(“logfile.txt”,__FILE__ . “is ” . print_r($_POST,true),FILE_APPEND);
^_^
一个phpwind 8.0 utf8 系统错误表现为无法注册登录,费老劲调试,发现 data/sql_config.php 文件由于在windows 记事本编辑后导致被自动增加了bom ,前端cookie 输出因为bom 的 原因,导致浏览器无法生成cookie,从而无法登录和注册
在editplus 另存成utf-8 无bom ,上传问题解决
总结: 要多用 linux curl 去查看文件输出
今天一个客户给我发来ecshop后台导出出现
ERROR 1052 (23000): Column ‘brand_id’ in where clause is ambiguous
经查发现是不同表存在相同字段而在where 语句中未区分造成
测试运行语句
SELECT g.*, b.brand_name as brandname FROM `usason`.`ecs_goods` AS g LEFT JOIN `usason`.`ecs_brand` AS b ON g.brand_id = b.brand_id WHERE is_delete = 0 AND brand_id = ’17’;
修改为
SELECT g.*, b.brand_name as brandname FROM `usason`.`ecs_goods` AS g LEFT JOIN `usason`.`ecs_brand` AS b ON g.brand_id = b.brand_id WHERE is_delete = 0 AND g.brand_id = ’17’;
红色部分注意
那么就只有去查后台程序代码了
发现在admin/includes/lib_main.php 的get_where_sql($filter)的函数中出现了
$where .= isset($filter->brand_id) && $filter->brand_id > 0 ? ” AND brand_id = ‘” . $filter->brand_id . “‘” : ”;
修改为
$where .= isset($filter->brand_id) && $filter->brand_id > 0 ? ” AND g.brand_id = ‘” . $filter->brand_id . “‘” : ”;
问题解决
目前还不知道有其他副作用
好在ecshop命名还算规范
朋友网站phpwind 7.5 sp3出现批量上传文件后上传文件的列表消失,但是文件已经上传上去了,调试后发现没有写入数据库
跟踪代码在 lib/upload/mutiupload.class.php 文件的update函数中加入调试语句,确认没有写入数据库 ,
原因是 $value[‘name’] = pwConvert($value[‘name’], $db_charset, ‘utf-8’); 行有错
经调试 pwConvert 是因为 php没有启用 mbstring 造成,启用后,问题解决
一般说来搜索的结果静态化可以持久的保持搜索结果,给客户良好的印象
ecshop 的搜索结果是 search.php?encode=base64编码字符串
我们希望用 /search_搜索关键字_p页码.html 来做静态优化
那么方法是什么呢:
首先写 .htaccess 文件
RewriteRule ^search_(.+?)_p([0-9]+).html$ search2\.php\?keywords=$1&page=$2 [QSA,L]
我们复制 search.php 成 search2.php 注释掉行18-行66
然后加入
$string["keywords"]=addslashes($_GET["keywords"]); $string["page"]=addslashes($_GET["page"]); $string["search_encode_time"] = $_SERVER["REQUEST_TIME"];
测试 http://域名/search_关键字_p1.html
如果和 http://域名/search2.php?keywords=关键字&page=1
的结果一致
然后我们去修改页码处的连接
行 501
$pager = get_pager2('search_', $pager['search'], $count, $page, $size);
在include/lib_main.php 里面 复制get_pager 函数成 get_pager2
然后修改成如下
$url_format = $url . $param_url . 'page='; $url_format2 = $url . $param['keywords'] . '_p'; $pager['page_first'] = ($page - $_offset > 1 && $_pagenum < $page_count) ? $url_format2 . "1.html" : ''; $pager['page_prev'] = ($page > 1) ? $url_format2 . $page_prev.".html" : ''; $pager['page_next'] = ($page < $page_count) ? $url_format2 . $page_next.".html" : ''; $pager['page_last'] = ($_to < $page_count) ? $url_format2 . $page_count.".html" : ''; $pager['page_kbd'] = ($_pagenum < $page_count) ? true : false; $pager['page_number'] = array(); for ($i=$_from;$i<=$_to;++$i) { $pager['page_number'][$i] = $url_format2 . $i.".html"; }
有条件的用户可以通过修改include/modules/payment/paypal.php 文件 后 “固定”此文件方式连防止后台paypal的账号被修改
至于固定的方式则各种系统不同
1)windows 可以通过ntfs的权限系统设置文件只读
2)linux 系统可以通过 chattr +i 的方式 强制固定文件
进入后台 SQL查询
INSERT INTO `你的前缀_shop_config` (`parent_id`, `code`, `type`, `store_range`, `store_dir`, `value`, `sort_order` ) VALUES ( ‘2’, ‘onlinepay_points’, ‘text’, ”, ”, ‘100’, ‘1’);
在后台 商店设置->基本设置->会出现 onlinepay_points 为100的项目
respond.php 修改如下
$payment = new $pay_code();
$pay_result = $payment->respond();
$msg = $pay_result ? $_LANG[‘pay_success’] : $_LANG[‘pay_fail’];
if($pay_result){
if($pay_code == “alipay” || $pay_code == “tenpay” || $pay_code == “chinabank” ){
log_account_change($_SESSION[‘
问题描述:
ecshop 2.7.2 在 启用 paypal 支付方式后,使用paypal支付返回网站发生支付失败,实际已经支付的错误
解决方案:
本ecshop paypal 插件,采用 paypal IPN 服务器自动对单,免除掉单烦恼, 适用于ecshop 2.7.X 系列版本
联系方式:
QQ 733905
问题描述:
ecshop 在启用支付宝 alipay 支持方式 后,通过支付宝付费返回网站发生fail 错误,而支付宝已经扣费的问题
解决方案:
通过修改支付宝支付插件,结合支付宝特有的服务器间对账功能,彻底免除掉单烦恼,减少客服工作量。
联系方式: QQ 733905
费用 300元
功能:
1) 解决ecshop 支付宝插件返回时候显示付费不成功
2) 解决支付宝异步同步,彻底解除掉单困扰,省客服工作量
3) gbk utf-8 双版本
文件丢失
ecshop 的 includes/lib_common.php 之 load_config 函数对应读取文件没做合适的检验,导致如果文件为空,那么会使ecshop 完全瘫痪
function load_config() { $arr = array(); $data = read_static_cache('shop_config'); if ($data === false || empty($data['lang'])) // 原来 为 if ($data === false)
问题都是一个,结论总是奇形怪状.
状况: ecshop 验证码不显示
1) 原因1: 有客户试图用前台英文后台中文模式工作,他就仿照一些方法,覆盖了语言文件
导致一些CFG 后台设置的变量无法读取,
解决方法,修改 captcha.php 文件,不包含 init.php, 然后手动传入宽高变量
首先定义 ROOT_PATH
define(‘ROOT_PATH’, “绝对路径”);
然后
$img = new captcha(ROOT_PATH . ‘data/captcha/’, $_CFG[‘captcha_width’], $_CFG[‘captcha_height’]);
变为
$img = new captcha(ROOT_PATH . ‘data/captcha/’, 100, 20);
2) 原因2,修改了某些utf-8文件,结果保存成 utf-8+ 也就是传说中的 utf-8 with bom
解决方法,找到对应文件,应 editplus 重新保存成 utf-8 无bom
这篇博客将陆续写有关unicode , php 和 unicode , 其他语言的unicode 实现的问题
看到太多的各类系统整合ucenter出现的各种各样的问题,比如无法同步登入,同步退出,注册用户时候出现问题
研读过ucenter 的原理后,再结合测试 ucenter + modoer + discuz X 1.5 + ecshop 2.7.2 实现了完美的同步登入和退出
发现一个简单的方法就是,把ucenter 的data/cache/apps.php 文件复制到各个系统的 uc_client/data/cache/apps.php
就可以解决大半的同步问题
检查过上面问题后,再检查各个系统的关于ucenter 的配置处,确保key和uc里面的一致,然后清空各系统缓存,测试
另外还要看 这一篇
/ecshop-api-uc.html
With IPN the code will run regardless of whether or not the buyer reaches your final checkout page or not. Again, it is server-to-server communication and is entirely separate from the user’s interaction with your application.
翻译来的意思就是
ipn 代码不管客户端(浏览器) 购买者是否到达最终的反馈页面,IPN是服务器到服务器端的通信,IPN完全独立于用户浏览器和网站应用程序之间的交互(指购买者浏览器和商品网站)
如下文章可以解释的很清晰 IPN 和 PDT 的区别了
一句话解释就是 PDT 是依靠客户浏览器返回到商品网站来确认付款成功,而IPN则可独立于浏览器和服务器之间,IPN 是端到端(Paypal 到 网站) 的沟通,他可防止所谓的掉单现象的发生,对于一些需要自动化的任务有较好的效果,(比如游戏币的自动发卡,自动充值)。
详细的上下文如下https://www.x.com/docs/DOC-2502
中文说明在
http://paypal.ebay.cn/integrationcenter/list__resource_2.html
I’d like to backup just a little bit now and discuss some of the differences between Instant Payment Notification (IPN) and Payment Data Transfer (PDT). They are very similar in the way they work so if you’re already familiar with PDT you may feel right at home with IPN. There is really one major difference that is very important to understand.
PDT was designed with one simple goal in mind: provide transaction data to checkout systems using Payments Standard so that it can be displayed on the merchant’s “thank you” or “completed” page. When utilizing PDT you have the option of data being returned as form data (POST) or as URL parameters (GET). You can then build your thank you page in a dynamic fashion so that users can print the page as a receipt, simply save it for their records, etc. It is a very useful tool when this is necessary, however, you cannot rely on PDT for automating tasks because there is no guarantee that the user will ever make it to your “thank you” page when working with PayPal Standard Payments. Even with Auto-Return enabled in your PayPal profile the user could close the browser before being redirected and the code on your thank you page will never run.
With IPN the code will run regardless of whether or not the buyer reaches your final checkout page or not. Again, it is server-to-server communication and is entirely separate from the user’s interaction with your application. Once that transaction is complete the data will be sent to your IPN listener and will be handled accordingly. This is why it is highly recommended you utilize Instant Payment Notification instead of Payment Data Transfer when automating tasks on the back-end.
phpmyfaq 2.5.2 的 inc/Link.php 文件里面的
function toString($forceNoModrewriteSupport = false)
函数是处理phpmyfaq 静态化的根本函数
一句话说就是
妈的,默认没开启 eAccelerator_get 和 eAccelerator_put
这个链接 http://eaccelerator.net/ticket/37 是说明
这里人解释的更清晰了
http://www.vbseo.com/blogs/danny-bembibre/enable-caching-functions-get-put-eaccelerator-45/
翻译成中国话就是
”
现在默认禁用了 eAccelerator_get 和 eAccelerator_put
想启用就加
–with-eaccelerator-shared-memory
共勉吧 php兄弟们
例子来源于我在给一个朋友配置服务器时候 一个电影程序 skyuc 的缓存需要配置 datastore_eaccelerator
而此程序检测 eAccelerator_get 函数是否存在以判断 eaccelerator 是否安装,
在phpinfo 里面即使看到了 eaccelerator ,仍然导致程序失败,调试后发现此原因.
另外发现 0.9.6 的eaccelerator 似乎即使加了这个也不好使,只能降级用 0.9.5 版本的eaccelerator
正常安装 php 加下面一步
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64
经常看到有初入PHP道朋友对于php程序出现问题素手无策的情况
这是稍微有经验的phper 都会采用如下方式来解决问题
1. 看错误输出, 从输出项 反查源码,在源码处上下文加入调试代码,代码可以是最简单的
$debuglineno = __LINE__;
die($debuglineno);
2. 根据错误输出 Google 之 或者 百度一下
错误的做法:
1. 直接问你的上级,或者同事
2. 直接!上论坛求助 而不是首先经过自己排查
3. 不去分析问题,而是发牢骚