Bonjour aide moi svp avec ce code

Fermé
Topson1 Messages postés 14 Date d'inscription mardi 27 février 2018 Statut Membre Dernière intervention 24 septembre 2019 - Modifié le 1 mars 2018 à 16:12
jordane45 Messages postés 38144 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 21 avril 2024 - 1 mars 2018 à 17:07
mon site :http://tvhitpro.ga/login.php Nom:admin Mot passe: admin @ 123

Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/vol15_4/xtreemhost.com/xth_21675441/htdocs/login.php on line 6

Warning: mysql_query(): No such file or directory in /home/vol15_4/xtreemhost.com/xth_21675441/htdocs/login.php on line 6

Warning: mysql_query(): A link to the server could not be established in /home/vol15_4/xtreemhost.com/xth_21675441/htdocs/login.php on line 6

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/vol15_4/xtreemhost.com/xth_21675441/htdocs/login.php on line 7

Voir code sur l'image





Code login


<?php
include("include/conf.php");

if(isset($_POST['submit']))
{
$query = mysql_query("select * from admin_login where username='".$_POST['username']."' and password='".$_POST['password']."'");
while($check_row=mysql_fetch_array($query))
{
$_SESSION['admin_login_status']="1";
$_SESSION['admin_id']=$check_row['id'];
$_SESSION['admin_name']=$check_row['user_name'];
echo "<script language='javascript'>window.location='manage_banner.php';</script>";
die();
}
}


?>
<title>Welcome to Control Panel</title>
<link rel="stylesheet" href="css/admin.css" type="text/css" />

<form name="frmLogin" action="" method="post">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" class="texttitle">

</td>

</tr>
</table>

<table align="center" width="25%" cellpadding="2" cellspacing="0" border="0" class="even_row_border">
<tr>
<td colspan="3" class="field_row" style="height:30px" align="center">Administrator login</td>
</tr>
<tr class="odd_row">
<td class="detaild">User Name</td>
<td>:</td>

<td class="detaild"><input type="text" name="username"></td>
</tr>
<tr class="odd_row">
<td class="detaild">Password</td>
<td>:</td>
<td class="detaild"><input type="password" name="password"></td>
</tr>
<tr class="odd_row">
<td colspan="3" align="center">
<input type="hidden" name="session_uniq_id" value="<?php echo $_SESSION['session_uniq_id']; ?>">
<input type="submit" name="submit" value="Login">
</td>
</tr>
</table>
</form>
</body>
</head>
A voir également:

3 réponses

fermiparadoxx Messages postés 11645 Date d'inscription samedi 19 août 2017 Statut Membre Dernière intervention 8 juin 2022 5 938
1 mars 2018 à 15:47
Bonjour,

Vous aider à quoi ???

En attendant, lisez ceci :
https://www.commentcamarche.net/infos/25899-demander-de-l-aide-pour-vos-exercices-sur-ccm/
0
diablo13800 Messages postés 2890 Date d'inscription jeudi 2 juillet 2015 Statut Membre Dernière intervention 16 février 2024 1 844
1 mars 2018 à 15:49
Bonjour,

La première erreur ( et qui pourrait vous facilité la vie) est une problème de dépréciation... Cela signifie que vous utilisé quelque chose de trop vieux...

Plutôt que d'utiliser Mysql_query, utilisé PDO c'est plus simple à utiliser et cela vous enlèvera quelque erreurs...
0
jordane45 Messages postés 38144 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 21 avril 2024 4 650
1 mars 2018 à 17:07
Bonjour,

1 - Attention, l'extension mysql était obsolète en PHP 5.5.0, et a été supprimée en PHP 7.0.0.
https://www.commentcamarche.net/faq/43261-php-l-extension-mysql-est-obsolete#top

À la place, tu peux (<gras DOIS </gras> ) utiliser l'extension MySQLi ou l'extension PDO_MySQL
https://www.commentcamarche.net/faq/44117-connexion-a-une-base-avec-pdo-mysqli

Si tu choisis PDO, pense à activer la gestion des erreurs : https://forums.commentcamarche.net/forum/affich-37584941-php-pdo-gerer-les-erreurs
0