Gå til anden side efter kommando !
Jeg har et Gæstekartotek for den vender tilbage til samme side når der er indtastet oplysninger !!Hvordan får jeg den til at gå til en ny side ?? Hvad skal der tilføjes ?
her min kode
--------
<%
Dim stMode
stMode = request("mode")
Dim DirPath, MDBPath, DBPath, connect
DirPath = Request.serverVariables("APPL_PHYSICAL_PATH")
MDBPath = "../database/users.mdb"
DBPath = Dirpath & MDBPath
Set Connect = server.createobject("ADODB.connection")
Connect.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & DBPath
Dim browser
browser = request.serverVariables("HTTP_USER_AGENT")
If stMode = "addUser" then
Dim stusername, stpassword, stpasswordrepeat, stpost, stby, stcpr, stemail, stsex, stadress, stmobiltelefon
stusername = request("userName")
stpassword = request("password")
stpasswordrepeat = request("passwordRepeat")
stemail = request("email")
stsex = request("sex")
stpost = request("post")
stby = request("by")
stcpr = request("cpr")
stemail = request("email")
stadress = request("adress")
stmobiltelefon = request("mobiltelefon")
Dim validateForm, username, email, sex, adress, by, post, cpr, mobiltelefon, password, passwordRepeat, nameCheck, checkNameRs, sqlCheckName
validateForm = "validated"
If len(stUserName) < 1 OR len(stUserName) > 20 then
validateForm = "invalid"
userName = "error"
end if
If len(stadress) < 1 OR len(stadress) > 50 then
validateForm = "invalid"
adress = "error"
end if
If len(stby) < 1 OR len(stby) > 20 then
validateForm = "invalid"
by = "error"
end if
If len(stcpr) < 1 OR len(stcpr) > 6 then
validateForm = "invalid"
by = "error"
end if
If len(stpost) < 1 OR len(stpost) > 4 then
validateForm = "invalid"
by = "error"
end if
If len(stmobiltelefon) > 8 then
validateForm = "invalid"
telefon = "error"
end if
If len(stemail) < 1 OR len(stemail) > 20 then
validateForm = "invalid"
email = "error"
end if
If len(stpassword) < 3 OR len(stpassword) > 10 then
validateForm = "invalid"
password = "error"
end if
If stpasswordrepeat <> stpassword then
validateForm = "invalid"
passwordRepeat = "error"
end if
Set checkNameRs = Server.CreateObject("ADODB.Recordset")
sqlCheckName = "SELECT [email] FROM tblUsers WHERE [email] = '" & stemail & "';"
checkNameRs.Open sqlCheckName, Connect
If not checkNameRs.bof then
validateForm = "invalid"
nameCheck = "error"
end if
If validateForm = "validated" then
Dim sqlAddUser
sqlAddUser = "INSERT INTO tblUsers ([username], [adress], [by], [Post], [Cpr], [mobiltelefon], [sex], [email], [password]) VALUES('" & stusername & "', '" & stadress & "', '" & stby & "', '" & stpost & "', '" & stcpr & "', '" & stmobiltelefon & "', '" & stsex & "', '" & stemail & "', '" & stpassword & "') ;"
connect.execute(sqlAddUser)
validateForm = "validated"
end if
end if
%>
<HTML>
<HEAD>
<TITLE>Bruger oprettelse</TITLE>
<STYLE>
body {
font-family: verdana;
}
</STYLE>
</HEAD>
<BODY bgcolor="#000000" link="#808080" vlink="#808080" alink="#808080">
<DIV CLASS="header"><b><u><font size="3" color="#FFFFFF"><img border="0" src="logo.gif"></font><font color="#FFFFFF" size="5">Gæstekartotek</font></u></b></DIV>
<FORM NAME="frmUsers" METHOD="post">
<INPUT TYPE="hidden" NAME="mode" VALUE="addUser">
<TABLE BORDER="0">
<TR>
<TD>
<b><font color="#FFFFFF">Køn: </font></b></TD>
<TD>
<select size="1" NAME="sex">
<option>Mand</option>
<option>Kvinde</option>
</select>
</TR>
<tr>
<TD>
<b><font color="#FFFFFF">Fulde Navn:</font></b></TD>
<TD <% if username = "error" then response.write "BGCOLOR=""red""" end if %> >
<font color="#FFFFFF">
<INPUT maxLength="20" TYPE="text" NAME="username" size="21"></font></TD>
</tr>
<TR>
<TD>
<b><font color="#FFFFFF">Adresse:</font></b></TD>
<TD <% if adress = "error" then response.write "BGCOLOR=""red""" end if %> >
<font color="#FFFFFF">
<INPUT maxLength="20" TYPE="text" NAME="adress" size="21"></font></TD>
</TR>
<tr>
<TD>
<b><font color="#FFFFFF">Postnummer:</font></b></TD>
<TD <% if by = "error" then response.write "BGCOLOR=""red""" end if %> bgcolor="#000000" bordercolorlight="#808080" bordercolor="#808080" bordercolordark="#808080" >
<font color="#FFFFFF">
<INPUT maxLength="4" TYPE="text" NAME="post" size="21"></font></TD>
</tr>
<tr>
<TD>
<b><font color="#FFFFFF">By:</font></b></TD>
<TD <% if by = "error" then response.write "BGCOLOR=""red""" end if %> >
<font color="#FFFFFF">
<INPUT maxLength="20" TYPE="text" NAME="by" size="21"></font></TD>
</tr>
<tr>
<TD>
<b><font color="#FFFFFF">Fødsels dato: ddmmaa</font></b></TD>
<TD <% if by = "error" then response.write "BGCOLOR=""red""" end if %> >
<font color="#FFFFFF">
<INPUT maxLength="6" TYPE="text" NAME="cpr" size="21"></font></TD>
</tr>
<tr>
<TD>
<b><font color="#FFFFFF">Mobiltelefon:</font></b></TD>
<TD <% if telefon = "error" then response.write "BGCOLOR=""red""" end if %> >
<font color="#FFFFFF">
<INPUT maxLength="8" TYPE="text" NAME="mobiltelefon" size="21"></font></TD>
</tr>
<tr>
<TD>
<b>
<font color="#FFFFFF">
E-mail:</font></b></TD>
<TD <% if email = "error" then response.write "BGCOLOR=""red""" end if %> >
<font color="#FFFFFF">
<INPUT maxLength="25" TYPE="text" NAME="email" <% if email <> "error" then response.write "VALUE=""" & stemail & """"%> size="21"></font></TD>
</tr>
<TR>
<TD>
<b>
<font color="#FFFFFF">
Password:</font></b></TD>
<TD <% if password = "error" OR passwordRepeat = "error" then response.write "BGCOLOR=""red""" end if %> >
<font color="#FFFFFF">
<INPUT maxLength="20" TYPE="password" NAME="password" size="21"></font></TD>
</TR>
<TR>
<TD>
<b>
<font color="#FFFFFF">
Gentag password:</font></b></TD>
<TD <% if passwordrepeat = "error" OR password = "error" then response.write "BGCOLOR=""red""" end if %> >
<font color="#FFFFFF">
<INPUT maxLength="20" TYPE="password" NAME="passwordRepeat" size="21"></font></TD>
</TR>
<TR>
<TD COLSPAN="2" ALIGN="right">
<font color="#FFFFFF">
<INPUT CLASS="botton" TYPE="reset" VALUE="Slet"> <INPUT CLASS="botton" TYPE="submit" VALUE="Opret"></font></TD>
</TR>
</TABLE>
</FORM>
<%
if validateForm = "invalid" then
response.write "<FONT COLOR=""red""><B>"
If userName = "error" then
response.write "Brugernavnet skal værer mellem 3 og 20 bogstaver. <BR>"
end if
If by = "error" then
response.write "By navn må maks være på 20 ciffer. <BR>"
end if
If post = "error" then
response.write "Post nummer må maks være 4 ciffer. <BR>"
end if
If cpr = "error" then
response.write "Cpr nummeret skal kun være de 6 første ciffre. <BR>"
end if
If adress = "error" then
response.write "Adressen må maks være på 50 ciffer. <BR>"
end if
If mobiltelefon = "error" then
response.write "Mobiltelefon nummeret kan kun være 8 ciffer. <BR>"
end if
If email = "error" then
response.write "E-mail adresse kun være på 20 ciffer. <BR>"
elseif nameCheck = "error" then
response.write "E-mail adressen er registret i forvejen, enten har du lavet en fejl eller så eksistere du allerede i kartoteket. <BR>"
end if
If password = "error" then
response.write "Passwordet skal værer mellem 3 og 10 bogstaver. <BR>"
elseif passwordRepeat = "error" then
response.write "De to passwords er ikke ens. <BR>"
end if
response.write "</B></FONT>"
end if
%>
<%
connect.close
set connect = nothing
%>
</BODY>
</HTML>