0

可能重复:
使用 mysql_real_escape_string() 时出错

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ksj'@'localhost' (using password: NO) in /home/ksj/public_html/cp/SuperSimpleBlogScriptV2_5_7/setup-complete.php on line 2

这是文件 setup-complete.php

<?php
$site = mysql_real_escape_string($_GET['site']);
$page = mysql_real_escape_string($_GET['page']);
$path = mysql_real_escape_string($_GET['path']);

//destroy the setup file
if(!unlink("$path/setup.php")){ /* try windows */ unlink("$path\setup.php"); }

header("Location: http://www.supersimple.org/success.php?link=$site/$page");
?>
4

1 回答 1

2

mysql_real_escape_string如果没有活动的连接,则需要隐式创建的连接。

首先使用正确的凭据打开连接

mysql_connect($server, $username, $password);
于 2012-05-24T23:58:11.110 回答