Php can';登录后看不到我的网站

Php can';登录后看不到我的网站,php,html,mysql,post,Php,Html,Mysql,Post,我的站点membre区域的'index.php'中有一个错误,我有这些错误 警告:mysql_connect()[function.mysql connect]:主机 不允许“srv9.000webhost.com”连接到此MySQL服务器 在第6行的/home/a8479867/public_html/pages/index.php中 警告:mysql\u select\u db():提供的参数无效 上的/home/a8479867/public_html/pages/index.php中的M

我的站点membre区域的'index.php'中有一个错误,我有这些错误

警告:mysql_connect()[function.mysql connect]:主机 不允许“srv9.000webhost.com”连接到此MySQL服务器 在第6行的/home/a8479867/public_html/pages/index.php中

警告:mysql\u select\u db():提供的参数无效 上的/home/a8479867/public_html/pages/index.php中的MySQL链接资源 第7行

警告:mysql\u query()[function.mysql query]:用户访问被拒绝 中的“a8479867”@“localhost”(使用密码:否) /第11行的home/a8479867/public_html/pages/index.php

警告:mysql\u query()[function.mysql query]:指向服务器的链接 无法在/home/a8479867/public_html/pages/index.php中建立 第11行

错误SQL

SELECT count(*) FROM membre WHERE login="momo1o4" AND pass_md5="b83287a789719ce4a412b0b9da582cee"
Access denied for user 'a8479867'@'localhost' (using password: NO)
这是我的密码

<?php
// on teste si le visiteur a soumis le formulaire de connexion
if (isset($_POST['connexion']) && $_POST['connexion'] == 'Connexion') {
    if ((isset($_POST['login']) && !empty($_POST['login'])) && (isset($_POST['pass']) && !empty($_POST['pass']))) {

    $base = mysql_connect ('server', 'login', 'password');
    mysql_select_db ('nom_base', $base);

    // it tests whether a database entry contains the couple login / pass
    $sql = 'SELECT count(*) FROM membre WHERE login="'.mysql_escape_string($_POST['login']).'" AND pass_md5="'.mysql_escape_string(md5($_POST['pass'])).'"';
    $req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
    $data = mysql_fetch_array($req);

    mysql_free_result($req);
    mysql_close();

    // if a response is obtained, then the user is a member
    if ($data[0] == 1) {
        session_start();
        $_SESSION['login'] = $_POST['login'];
        header('Location: membre.php');
        exit();
    }
    // if there is no response, the visitor was wrong either in his login or password in
    elseif ($data[0] == 0) {
        $erreur = 'Compte non reconnu.';
    }
    // if not, then there is a big problem :)
    else {
        $erreur = 'Probème dans la base de données : plusieurs membres ont les mêmes identifiants de connexion.';
    }
    }
    else {
    $erreur = 'Au moins un des champs est vide.';
    }
}
?>
<html>
<head>
<title>Accueil</title>
</head>

<body>
Connexion à l'espace membre :<br />
<form action="index.php" method="post">
Login : <input type="text" name="login" value="<?php if (isset($_POST['login'])) echo htmlentities(trim($_POST['login'])); ?>"><br />
Mot de passe : <input type="password" name="pass" value="<?php if (isset($_POST['pass'])) echo htmlentities(trim($_POST['pass'])); ?>"><br />
<input type="submit" name="connexion" value="Connexion">
</form>
<a href="inscription.php">Vous inscrire</a>
<?php
if (isset($erreur)) echo '<br /><br />',$erreur;
?>

</body>
</html>

阿奎尔
连接空间记忆:
登录:
您似乎正在尝试使用ftp用户名(a8479867)连接到mysql,但我很确定您仍然需要手动将该用户(使用正确的密码)添加到mysql


在webhost面板中应该有一个选项来创建mysql用户并更新他们的密码。

我认为这个错误是描述性的<代码>拒绝用户“a8479867”@“localhost”的访问(使用密码:否)。。。确保数据库连接的用户名和密码正确。显然,MySQL服务器的用户名有问题。确保您使用的用户名、密码和主机名正确。问题在于您的数据库连接。您没有提供任何数据库连接的密码。您能告诉我如何向数据库添加密码吗?旁注:md5不应用于哈希密码,而且您确实应该将sql代码移植到mysqli或PDO。它们不再得到维护。看到了吗?相反,学习,并使用或-将有所帮助。如果你选择PDO,