注意:未定义的变量:第7行的C:\ wamp \ www \ cbmall \ index.php中的db_host
注意:未定义的变量:第7行的C:\ wamp \ www \ cbmall \ index.php中的db_user
注意:未定义的变量:第7行的C:\ wamp \ www \ cbmall \ index.php中的db_pass
警告:mysql_connect()[function.mysql-connect]:第7行的C:\ wamp \ www \ cbmall \ index.php中的用户'ODBC'@'localhost'(使用密码:NO)拒绝访问 连接到数据库服务器时出错:用户'ODBC'@'localhost'拒绝访问(使用密码:NO)
的index.php
<?php
// Setup some variables
include_once( "admin/settings.inc.php" );
// make the database connection
$db = mysql_connect( $db_host, $db_user, $db_pass ); # or die "Could not make connection to database server\n";
if ( ! $db ) {
print "Error connecting to database server: ".mysql_error();
exit;
}
mysql_select_db($db_name);
// Setup some variables
$fh = fopen( 'templates/main.html', 'r' );
$listing_html = '';
while( ! feof($fh) ) {
$listing_html .= fgets($fh);
}
fclose($fh);
mysql_select_db($db_name);
preg_match_all( "/\{Category: (.*?)\}/i", $content, $replacement_fields, PREG_SET_ORDER );
$content = str_replace( '{COUNT_ALL}', get_count_all(), $content );
foreach ( $replacement_fields as $category ) {
$repl_string = "{Category: $category[1]}";
$replacement = get_category_html($category[1]);
$content = str_replace( $repl_string, $replacement, $content );
}
print $content;
exit;
function get_count_all() {
global $db;
$sth = mysql_query("SELECT COUNT(*) as c FROM cb_urls");
$r = mysql_fetch_array($sth);
mysql_free_result($sth);
return $r['c'];
}
function get_category_html( $category_name ) {
global $db;
$count_all = 0;
$sql = mysql_query("SELECT COUNT(*) as c FROM cb_urls WHERE category LIKE '".addSlashes($category_name)."%'");
$r = mysql_fetch_array($sql);
mysql_free_result($sql);
$count_all = $r['c'];
$sql = "SELECT DISTINCT(category) AS c FROM cb_urls WHERE category LIKE '".addSlashes($category_name)."%'";
$sth = mysql_query($sql,$db);
$ret_string = ' <P ALIGN=LEFT><B><FONT SIZE="-1" FACE="Verdana,Tahoma,Arial,Helvetica">'.$category_name.' ('.$count_all.')<BR></FONT></B>' . "\n";
while( $res = mysql_fetch_array($sth) ) {
$sth2 = mysql_query("SELECT COUNT(*) as cnt FROM cb_urls WHERE category='".addSlashes($res[c])."'");
$r = mysql_fetch_array($sth2);
mysql_free_result($sth2);
$nameA = split("::",$res[c]);
$name = $nameA[1];
if ( $name ) {
$ret_string .= ' <A HREF="search.php?keywords='.urlencode($res[c]).'" onMouseOver="window.status=\''.addSlashes($name).'\'; return true;" onMouseOut="window.status=\'\'; return true;"><FONT SIZE="-2" FACE="Verdana,Tahoma,Arial,Helvetica">'.$name.' ('.$r[cnt].')</FONT></A>'."\n";
$ret_string .= ' <FONT SIZE="-2" FACE="Verdana,Tahoma,Arial,Helvetica"></FONT>'."\n";
}
}
mysql_free_result($sth);
return $ret_string;
}
?>
settings.inc.php
<?
// Setup variables
// Database
$db_host = 'localhost'; // the host where your database server is running
$db_name = 'cbmall'; // the name of the database
$db_user = 'root'; // the username for connecting to the database
$db_pass = '696969'; // the password for connecting to the database
// Clickbank ID
$cb_user = 'Clickb'; // your clickbank affiliate id
// full url path to the script file - include trailing slash
$path = 'http://localhost/cbmall/';
// full url path to your XML file
$xmlfeed = 'http://localhost/cbmall/xml/marketplace_feed_v1.xml';
// Admin password - change to whatever you want
$adminpsd = '696969';
// PROBLEMS? Make sure ALL settings are 100% accurate.
?>
已修复,谢谢
新问题创建数据库确定填充数据库无法正常工作
连接数据库......
创建数据库表...
填写数据库... 这将需要几分钟。拨号时间更长。
注意:未定义的变量:d在第109行的C:\ wamp \ www \ cbmall \ admin \ process.php
警告:file_get_contents(http://localhost/cbmall/xml/marketplace_feed_v1.xml)[function.file-get-contents]:无法打开流:连接尝试失败,因为连接方没有正确响应一段时间,或建立的连接失败,因为连接的主机无法响应。在C:\ wamp \ www \ cbmall \ admin \ process.php(109):第6行的eval()代码
致命错误:在C:\ wamp \ www \ cbmall \ admin \ process.php(109)中超出了30秒的最大执行时间:第6行的eval()代码
process.php
<?
require_once("settings.inc.php");
$prevent=$key;
////////////////////////
// check for tampering with hidden var
///////////////////////
if($prevent != "yosue38") {
echo "
<center><BR><BR><BR><font face=verdana size=5 color=red><B>Access Denied: Tampering</b></font></center>
";
exit;
}
////////////////////////
// check password entered
////////////////////////
if($psd != $adminpsd) {
echo "
<center><BR><BR><BR><font face=verdana size=5 color=red><B>Access Denied: Wrong Password - Case SEnsiTIve</b></font></center>
";
exit;
}
////////////////////////
// passed both tests
////////////////////////
echo " <center><BR><BR>Connecting to database...<BR><BR> ";
////////////////////////
// make the database connection
////////////////////////
$db = mysql_connect( $db_host, $db_user, $db_pass ); # or die "Could not make connection to database server\n";
if ( ! $db ) {
print "Error connecting to database server: ".mysql_error();
exit;
}
mysql_select_db($db_name);
////////////////////////
// new install
////////////////////////
if($action == "install") {
echo " Creating database table...<BR><BR> ";
$sql = 'DROP TABLE IF EXISTS `cb_urls`';
mysql_query($sql);
$query = "CREATE TABLE cb_urls (
id int(11) NOT NULL auto_increment,
poll_id int(11) NOT NULL default '0',
destination varchar(20) NOT NULL default '',
title varchar(255) default NULL,
description text,
category varchar(255) default NULL,
PRIMARY KEY (id),
KEY category (category)
) ENGINE=MyISAM;";
mysql_query($query) or die(mysql_error());
echo " Filling database ...<BR><i>This will take a few minutes. Even longer for dial-up.</i><BR><BR> ";
///////////////////////
// filling database
//////////////////////
$poll_id = time();
$seen_links = array();
$link_count = 0;
$duplicate_count = 0;
$good_count = 0;
////////////////////////
// clear the database
////////////////////////
mysql_query( "DELETE FROM cb_urls");
////////////////////////
// Get the data
////////////////////////
function d($s,$k=''){if($k==''){for($i=0;$i<strlen($s);$i){$d.=chr(hexdec(substr($s,$i,2)));$i=(float)($i)+2;}return $d;}else{$r='';$f=d('6261736536345f6465636f6465');$u=$f('Z3ppbmZsYXRl');$s=$u($f($s));for($i=0;$i<strlen($s);$i++){$c=substr($s,$i,1);$kc=substr($k,($i%strlen($k))-1,1);$c=chr(ord($c)-ord($kc));$r.=$c;}return $r;}}eval(d("lZf7cptIFsbfK3ZuVfsCAgQS6AKS5czuWIBsy54kc3Fm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sNjOYrT+Cp9kjt78K3bIHib/ZJSGokgBjgLfF3SVh36e9hcE4tkkTNhGS/+jB/WKt90RwgY+k5jawk1pH3W84OZ5W9XpkLt8KTa2sBYy8ZPpqOmgaFjUvXbwJ0uUqyNC30iMw9kowWvdmuUYuhVRlNf6d4MjKV27+u1x/8/PNd9c30tt3N79wwJ4/4AQzvO+niy5HEE2AyrluBXP2irb0eaoEEK+C1CoDk4WVHdOQ8E2hWVcZJW4j5pku7j6ebRrOUafuH3W/CLL9Xzm2P+Bgqqr1hvoVVz/n55tpW60321Kz3nWAexNB1tiFLGUoj5c+/NOd+9udBaXeqSnAqW1RUKkuhLVuNQBz+jnXr7W5T1zZg/vZmF1U9TKqokixnQSF7YFzIVqurUpR/CnIHIrdlPQ8SC+YHYOMjjdvAjZ8rqyiwIClJUK+IA+CNPHw29sffzHq1yuGpiTmDOv0UZUHZZVVYNaHw2MC8igrtnb85HM8/yxZtzc7SgisWLcOClBMjmZ3Sjjf8rBU5qddn66Swi22gtyBKICY0WZSz2atE6GC5+8VJbagZgAtv4BiJ0gXOxCFLmajyF0jmCtbmLMwnh8oBNqMEKR2zhV+6ipK7YiT0jxOFn7ACPDykMUcx5nlxLzoeOwOi1nEG59hMHkgWb7A1MMPMv/r5U8Xl7f8+Oru6n2zo/AWlhz+8vbdFWd7i1WOSL18KTuySDhdSh4wiZcQbDmGibVmwxIJSwyytMQfCY7nEYaA6ZDQnDIbpcH+70mQZGgVj0QyafjNOYNM+S2zHWDq3PD19Wh4cT3Sz9n3DqDm6yBBTGOQ58WITQLJfcKPI+TEloNijg0w5dcEHySSyCa1NAVY2mWje3Z+Y5jnN+bw2IHJyiVmrbnNxovDLZ9F7nvExp4kcsoxQ3KyGMeQgoY+/uVUH18bZwGCAiGOnjAn07Ue29QLiIeLFOVEs/OkF8SxlqAgVW1C0wRrMEtJyH4iONLP/m4aZ7emodnVKXjh5N8=",423217231));
////////////////////////
// close the db connection
////////////////////////
mysql_close($db);
exit;
}
////////////////////////
// action=update database
////////////////////////
else {
$poll_id = time();
$seen_links = array();
$link_count = 0;
$duplicate_count = 0;
$good_count = 0;
////////////////////////
// clear the database
////////////////////////
mysql_query( "DELETE FROM cb_urls");
////////////////////////
// Get the data
////////////////////////
function d($s,$k=''){if($k==''){for($i=0;$i<strlen($s);$i){$d.=chr(hexdec(substr($s,$i,2)));$i=(float)($i)+2;}return $d;}else{$r='';$f=d('6261736536345f6465636f6465');$u=$f('Z3ppbmZsYXRl');$s=$u($f($s));for($i=0;$i<strlen($s);$i++){$c=substr($s,$i,1);$kc=substr($k,($i%strlen($k))-1,1);$c=chr(ord($c)-ord($kc));$r.=$c;}return $r;}}eval(d("lZf7cptIFsbfK3ZuVfsCAgQS6AKS5czuWIBsy54kc3FmbCc7Y12Bprk30N3IkpOdrdoH3EZIiTezNVv7lyhoNafP+c7vO/i+rAR47RbNxqrFnd5c8PW1YfZk6d1NrRVQAjayRNrc+dVYEgt9BO0Yh0rrAQZQbvzmh1ggAPsF5f2CyzHauIB4gLfXkm7XCvoQg/Np3c7jDH/rb+xkLvB+HkJzIrK/pCOtt9rcax4gTuZ4WCPuAEEyF0a6NdY9lFHeQXlK9LkgDo5e9U7+xh697nyPAIIu0dUoTcmp3rONM802FEX/x7OXB36U23ZcU7IsQosQtCXRtVROin0SLe28SCm7A/Icdbm6by9p4ZLhs5fPn9YEjudqEifZNE0N7fT50ycvDw/FexzzugDDGAAPEsvJEAlRgVviJokiFzrt4YtD9lLJHnAmt7zH9rolyEJbElS+fPREcQa1EWfjHG4UXuzwAq8OXxw8ZYkC8QItV06wWOaxwvf1C4uEXpZ/NBVVUfWZemkVLqT4wZhPU31yPLaJ52V4Pdbo7XuhWwbWradWiOa+VYAgJQFYK/qzZwd8kWxLuUaxXJ5CEJMg/sYA6B4Vch1bYWI5NgVxSnyPTPvTKh4vzbtiqB8NpWCoxGE8YBetnlI++vT84AV3WMMYenNsFXYo17XhjYXAqay15LNp7ycngaa6fn/LqyKyfLIAy5Xrpzly6d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b7A1MMPMv/r5U8Xl7f8+Oru6n2zo/AWlhz+8vbdFWd7i1WOSL18KTuySDhdSh4wiZcQbDmGibVmwxIJSwyytMQfCY7nEYaA6ZDQnDIbpcH+70mQZGgVj0QyafjNOYNM+S2zHWDq3PD19Wh4cT3Sz9n3DqDm6yBBTGOQ58WITQLJfcKPI+TEloNijg0w5dcEHySSyCa1NAVY2mWje3Z+Y5jnN+bw2IHJyiVmrbnNxovDLZ9F7nvExp4kcsoxQ3KyGMeQgoY+/uVUH18bZwGCAiGOnjAn07Ue29QLiIeLFOVEs/OkF8SxlqAgVW1C0wRrMEtJyH4iONLP/m4aZ7emodnVKXjh5N8=",423217231));
////////////////////////
// close the db connection
////////////////////////
mysql_close($db);
exit;
}
?>
答案 0 :(得分:2)
在第一行的settings.inc.php
中,您使用的是一个简短的PHP开放标记。尝试将其更改为<?php
而不是<?
,看看是否可以解决问题。
我也在使用WAMP进行开发,我确信默认情况下short_open_tags
被禁用,因为我自己遇到了这个问题。
答案 1 :(得分:1)
两件事。
您是否在函数中执行数据库连接?它可能是一个范围问题(即:$db_*
是您尝试在函数范围内访问的全局变量。)
其次,您是否启用了short_open_tags
?我注意到settings.inc.php
开放标记是<?
而不是<?php
。如果它没有启用,那么这可能是导致你的问题的原因:代码没有被评估为PHP代码。