E' la prima volta provo a programmare con php infatti ho dei problemi!
Io sono nella pagina autenticazione.htm e inserendo nei campi user e password vado alla pagina dei servizi services.php
E' giusto fare in questo modo ?
-----------------------------------------
Autenticazione.htm
-----------------------------------------
----------------------------------Codice HTML:.... <body> <form action="services.php" method="get"> <div align="center">Nome Utente: <input type="text" name="user_name"> <br> Password: <input type="text" name="password"> <br> <br> <input type="submit" name="bINVIA" value="Login"> </div> </form> </body> ...
--------------------------------
Services.php
-------------------------------
---------------------------------------Codice PHP:<body>
<br><br>
<?
$user = "Qui ho messo il mio User";
$pass = "Qui ho messo la mia password";
$host = "localhost";
$database = "my_nome utente";
$db = mysql_connect($host, $user, $pass) or die("Errore durante la connessione al database");
mysql_select_db($database, $db) or die("Errore durante la selezione del database");
$sql_pass = "select Password from Utenti where User='$user_name'";
if($sql_pass == $password)
{echo "<br> Benvenuto nella pagina dei servizi";}
else
{"<h1> Errrore</h1>";}
?>
<br><br>
E' una prova!
</body>
E' giusto fare così?? Sicuramente ci son dei problemi perchè stampa solo "E' una prova" !!
Grazie tutti...
Antonio

LinkBack URL
About LinkBacks

