Formular problem
Når min bruger har udfyldt formen på siden add.asp (koden nedenfor) skal brugeren sendes videre til en ny side kaldet vidre.aspHvordan gør jeg det!
Det ville være fedt hvis der kom en popup op hvor der stod: Sourcen er nu oprettet!
og så når man trykker ok bliver man sendt videre!
Her er koden!
Det hele er lavet i ASP
<%
Const adOpenKeyset = 1
Const adLockOptimistic = 3
strMode = Request.QueryString(\"mode\")
tempConn = \"PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"profil.mdb\") & \";UID=;PWD=;\"
If Request.Form(\"Gem\") <> \"\" Then
strhits = Trim(Request.Form(\"hits\"))
strnavn = Trim(Request.Form(\"navn\"))
strurl = Trim(Request.Form(\"url\"))
streditorhomepage = Trim(Request.Form(\"editorhomepage\"))
streditoremail = Trim(Request.Form(\"editoremail\"))
strdemo = Trim(Request.Form(\"demo\"))
strniveau = Trim(Request.Form(\"niveau\"))
strtype = Trim(Request.Form(\"type\"))
strdescrip = Trim(Request.Form(\"descrip\"))
streditor = Trim(Request.Form(\"editor\"))
Set rs = Server.CreateObject(\"ADODB.RecordSet\")
strSQL = \"SELECT * FROM brugere WHERE (ID = 0)\"
rs.Open strSQL, tempConn, adOpenKeyset, adLockOptimistic
If (rs.BOF Or rs.EOF) Then
rs.AddNew
rs(\"hits\") = strhits
rs(\"navn\") = strnavn
rs(\"url\") = strurl
rs(\"editorhomepage\") = streditorhomepage
rs(\"editoremail\") = streditoremail
rs(\"demo\") = strdemo
rs(\"niveau\") = strniveau
rs(\"type\") = strtype
rs(\"descrip\") = strdescrip
rs(\"editor\") = streditor
rs.Update
End If
rs.Close
Set rs = Nothing
End If
%>
<html>
<head>
<style>
A:link {color : #333366;text-decoration: none}
A:visited {color : #333366;text-decoration: none}
A:active {color : #CC3300;text-decoration: none}
A:hover {color : #CC3300;text-decoration: none}
.t{font: 11px Verdana, Arial;text-decoration: none}
.overskrift{font: 20px Verdana, Arial;text-decoration: none}
.n{font: 10px/11px Verdana, Arial;text-decoration: none}
.red{ bgcolor : #105295;font: 10px/11px Verdana, Arial;text-decoration: none}
.hvid{font: 13px Verdana, Arial;text-decoration: none; color: #FFFFFF}
a.hvid{color : #FFFFFF;text-decoration: none}
A:link.hvid{color : #FFFFFF;text-decoration: none}
A:visited.hvid{color : #FFFFFF;text-decoration: none}
A:active.hvid{color : #FFFFFF;text-decoration: none}
</style>
<title>Velkommen til fun4you.dk community</title>
</head>
<body>
<div align=\"center\"><center><table width=\"488\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
<tr>
<td width=\"488\"><font face=\"Arial\" size=\"2\" color=\"Black\"><B>Opret Bruger</B><br><br><br></font></td>
</tr>
<tr align=\"center\">
<td width=\"100%\">
<form method=\"POST\" action=\"add.asp\">
<input type=\"hidden\" value=\"0\" name=\"hits\">
<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td valign=\"middle\" align=\"left\" colspan=\"2\"><font face=\"arial\" size=\"2\"><B><br>
</B>Tilføj din source til vores arkiv ved at udfylde formen:<B><br>
</B></font></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\"><div align=\"right\"><p><B><font face=\"arial\" size=\"2\">Navnet på din source</font></B></td>
<td valign=\"middle\" align=\"left\"><input type=\"text\" name=\"navn\" size=\"35\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\"><div align=\"right\"><p><B><font face=\"arial\" size=\"2\">Adressen <u>direkte</u> til sourcen</font></B></td>
<td valign=\"middle\" align=\"left\"><input type=\"text\" value=\"http://\" name=\"url\" size=\"35\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\"><div align=\"right\"><p><B><font face=\"arial\" size=\"2\">Din hjemmeside</font></B></td>
<td valign=\"middle\" align=\"left\"><input type=\"text\" value=\"http://\" name=\"editorhomepage\" size=\"35\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\"><div align=\"right\"><p><B><font face=\"arial\" size=\"2\">Din emailadresse</font></B></td>
<td valign=\"middle\" align=\"left\"><input type=\"text\" name=\"editoremail\" size=\"35\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\"><div align=\"right\"><p><B><font face=\"arial\" size=\"2\">Adressen <u>direkte</u> til en demo</font></B></td>
<td valign=\"middle\" align=\"left\"><input type=\"text\" value=\"http://\" name=\"demo\" size=\"35\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\"><div align=\"right\"><p><B><font face=\"arial\" size=\"2\">Niveau på sourcen</font></B></td>
<td valign=\"middle\" align=\"left\"><select size=\"1\" name=\"niveau\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\">
<option>Begynder</option>
<option>Øvet</option>
<option>Ekspert</option>
</select></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\"><div align=\"right\"><p><B><font face=\"arial\" size=\"2\">Type (fx. ASP eller PHP)</font></B></td>
<td valign=\"middle\" align=\"left\"><input type=\"text\" name=\"type\" size=\"35\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\"><div align=\"right\"><p><B><font face=\"arial\" size=\"2\">Kort beskrivelse af sourcen</font></B></td>
<td valign=\"middle\" align=\"left\"><textarea rows=\"4\" name=\"descrip\" cols=\"27\" style=\"border: 1; border-color: #000000; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"></textarea></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\"><div align=\"right\"><p><B><font face=\"arial\" size=\"2\">Dit navn</font></B></td>
<td valign=\"middle\" align=\"left\"><input type=\"text\" name=\"editor\" size=\"35\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"></td>
</tr>
<tr>
<td valign=\"middle\" align=\"left\" colspan=\"2\"><br>
<input type=\"submit\" value=\"Gem\" name=\"Gem\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"> <input type=\"button\" value=\"Annuller\" name=\"Annuller\" onClick=\"java script:history.back();\" style=\"border: 1; border-color: #FFFFFF; border-style: solid; font-family: Verdana; font-size: 8pt; font-weight:bold; background-color: #990000; color: #FFFFFF\" border-style: solid; font-family: \"Verdana\"; font-size: 8pt; font-weight:bold; background-color: \"#990000\"; color: \"#000000\" ; size=\"25\"></td>
</tr>
</table>
</form>
</tr>
</table>
</center></div>
</body>
</html>