Allora, sto creando un form per registrare gli utenti al sito, quindi ho creato un form con questo codice:
codice:
<html>
<head>
<title>Registrati!</title>
</head>
<body>


</p>
<p align="center"><font face="Verdana" size="3">Registrati subito! Inserisci
le informazioni richieste qua sotto!</font></p>
<form method="POST" action="registrazione2.asp">
<div align="center">
<center>
<table border="0" width="76%" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><font face="Verdana" size="2">Username:</font></td>
<td width="80%"><input type="text" name="username" size="20"></td>
</tr>
<tr>
<td width="20%"><font face="Verdana" size="2">Password:</font></td>
<td width="80%"><input type="password" name="password" size="20"></td>
</tr>
<tr>
<td width="20%"><font face="Verdana" size="2">E-mail:</font></td>
<td width="80%"><input type="text" name="email" size="20"></td>
</tr>
<tr>
<td width="100%" colspan="2">
<p align="center"><input type="submit" value="Invia" name="B1"><input
type="reset" value="Reimposta" name="B2"></p></td>
</tr>
</table>
</center>
</div>
</form>
<p align="left"></p>
</body>
</html>
Una cosa semplice che poi va alla pagina registrazione2 che inserisce i dati nel database... Il codice della pagina registrazione2 è questo:
codice:
<html>
<head>
<title>Registrati subito!</title>
</head>
<body>


<%
'Prendiamo le variabili dall'altro database
username = Replace(Request.Form("username"), "'", "''")
password = Replace(Request.Form("password"), "'", "''")
email = Request.Form("email")

'Connettiamoci al database
url_DB = "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/
database.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open url_DB
Set RecSet = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM Utenti where username = '" & username &"'"
RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
IF Not RecSet.Eof Then
'L'username è già in uso!
usato = True
Else
'L'username non è in uso!
usato = False
End IF
'Mostra un messaggio se l'username è già stato usato!
IF usato = True then
%>
<hr>
<p align="center"><font face="Times New Roman" size="2">Siamo spiacenti, ma l'username da lei scelto è già in uso!La prgehiamo di tornare indietro e di cambiare username.</font></p>
<hr>
<%
Else
'Il nick non è stato usato...Si procede all'installazione
Set RecSet = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM Utenti Order By ID Desc"
RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
RecSet.Addnew
RecSet("username") = username
RecSet("password") = password
RecSet("email") = email
RecSet("attivo") = 0
RecSet.Update
RecSet.Close
Set RecSet = Nothing
Set RecSet = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT ID FROM Utenti Where username = '" & username & "' and password
= '" & password &"'"
RecSet.Open SQL, Conn, adOpenStatic, adLockOptimistic
ID = RecSet("ID")
RecSet.Close
Set RecSet = Nothing
Conn.Close
Set Conn = Nothing

mittente = "morbibi@yahoo.it"

testo = "Caro utente," & chr(13)
testo = testo & "per attivare la registrazione al nostro sito, fai click sul link qui sotto" & chr(13)
testo = testo & "http://www.sitomio.it/attiva.asp?ID=" & id &"" & chr(13) & chr(13)
testo = testo & "Lo staff di Mio sito!" & chr(13)
testo = testo & "http://www.sitomio.it"

Set email = CreateObject("CDONTS.NewMail")
email.From = mittente
email.To = email
email.Subject = "[Harry Potter] ATTIVA LA REGISTRAZIONE!"
email.Body = testo
email.Send


Set email = nothing

%>
<hr>
<p align="center"><font face="Times New Roman" size="2">La registrazione è avvenuta con successo!Entro poco tempo riceverai un e-mail di conferma akll'indirizzo da te indicato!</font></p>
<hr>
</body>
</html>
A me sembra che non ci siano errori...Ma quando vado sul clicco su invia nel forum mi da: impossibile visualizzare la pagina Non capisco il perché!
Sapete aiutarmi?