Vai al contenuto

Non riesco a far funzionare il login del mio sito in locale


prinzart

Messaggi raccomandati

ciao, non riesco a far funzionare il login del mio sito, secondo voi dove sta il problema?

nel file function.inc ho messo il seguente codice:

<?

$conn=mysql_connect("localhost", "root", "");

mysql_select_db('Sql94280_1');

?>

e nel file index.php invece ho inserito questo:

<?

if ($logging==1){

session_start();

include ("function.inc");

$sql = "select * from admin where ((username='$login') and (pwd='$password')) ";

$rs = mysql_query($sql, $conn);

$row=mysql_fetch_array($rs);

if (($row==0)==true){

$msg="utente non riconosciuto";

} else {

$_SESSION['id_user'] = $row[id];

header("Location:agenti.php");

}

}

?>

<html>

<head>

<title>iris agency - Gestione Sito</title>

<? include "style.css";?>

</head>

<body leftmargin="0" marginheight="4" marginwidth="0" topmargin="4">

<table height="100%" align="center">

<tr>

<td>

<table cellpadding="0" cellspacing="1" align="center" bgcolor="#5a94cd">

<tr>

<td>

<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" align="center" width="776">

<TR>

<TD>

<table cellpadding="0" cellspacing="1" align="center" bgcolor="#5a94cd">

<tr>

<td>

<table cellpadding="0" cellspacing="0" align="center">

<tr>

<td bgcolor="#5a94cd" align="center">GESTIONE SITO</td></tr>

<tr>

<tr>

<td>

<table width="400" border="0" align="center" cellspacing="0">

<form action="<?=$PHP_SELF?>" method="post">

<tr align="center" bgcolor="#F2F2F2"><td height="45" colspan="2">Login<?

if ($msg) { echo "

<font color="#FF8000">$msg</font>";} ?></td></tr>

<tr bgcolor="#F2F2F2"><td colspan="2"></td></tr>

<tr bgcolor="#F2F2F2"><td>Username : </td><td><input name="login" type="text" class="input"></td></tr>

<tr bgcolor="#F2F2F2"><td>Password : </td><td><input name="password" type="password" class="input"></td></tr>

<tr bgcolor="#F2F2F2"><td align="center"colspan="2"><input type="hidden" name="logging" value="1"><input name="Submit" type="submit" class="pulsante" value=" invia "></td></tr>

</form>

</table>

</td>

</TR>

</table>

</td>

</tr>

</table>

</td>

</tr>

<?include ("footer.php");?>

</table>

</td>

</TR>

</table>

</td>

</tr>

</table>

iMac 27" - 2,8 GHz Quad-Core i7 - 4 GB RAM - 1 TB HD - 512 MB ATI

eMac 15" - 1 GHz - 768 MB RAM - 80 GB HD - 32 MB ATI

Power Mac 5400 14" - 200 MHz - 24 MB RAM - 1.6 GB HD - 1 MB ATI

Performa 630 14" - 33 MHz - 4 MB RAM - 500 MB HD - 1 MB ATI

Link al commento
Condividi su altri siti

Archiviato

Questa discussione è archiviata e chiusa a future risposte.

×
×
  • Crea Nuovo...