cwk32 2007-5-13 14:10
谁帮我测试下...
需要上传论坛LOGO到images/imgad.gif
代码:
[code]<?php
define('CURSCRIPT', 'seccode');
require_once './include/common.inc.php';
if(preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])) {
readfile("images/imgad.gif");
exit();
}
if($discuz_uid==0){
readfile("images/imgad.gif");
exit();
}
if(!$_COOKIE && !$_SERVER["HTTP_USER_AGENT"]){
readfile("images/imgad.gif");
exit();
}
if(!empty($uid)) {
$uid = intval($uid);
}
if($creditspolicy['promotion_visit']) {
if($uid) {
$db->query("REPLACE INTO {$tablepre}promotions (ip, uid, username) VALUES ('$onlineip', '$uid', 'imgphp')");
}
}
if($creditspolicy['promotion_register']) {
if($uid) {
dsetcookie('promotion', ($_DCOOKIE['promotion'] = $uid), 30);
}
}
readfile("images/imgad.gif");
exit();
?>[/code]
放到根目录
用来扩展推广功能
大家以XXX.php?uid=1的方式访问看看(先清除Cookies),然后再注册一个,看看uid为1的帐户的贡献值有没有增加就行了..
asd1 2007-5-14 20:47
回复 #8 lee 的帖子
呵呵,果然是高手。。。 ;P