indsæt hvordan
Hvordan skal denne se ud : <html><head>
<title>New Page 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body>
<div align="center"><center>
<table border="0" width="953" cellpadding="0" cellspacing="1" bordercolor="#000000">
<tr>
<strong><td valign="middle" width="932" bordercolor="#000000"
style="border: 1px solid rgb(0,0,0)" bgcolor="#A0B3C8"><p align="center"></strong><small><font
face="Arial">Indsæt ny Babe</font></small><strong></p>
<a </tr><font size="2"><form
action="default1.asp"
method="post">
<p></font><%
set rs = server.CreateObject("ADODB.Recordset")
set conn = server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& server.mappath("../1q/db.mdb")
strSQL = "select * from babeometer"
Set rs = Conn.Execute(strSQL)
%><%
'Tjek om form er send til seid så gem i databasen:
if request.servervariables("REQUEST_METHOD") = "POST" then
kol1tekst = Replace(Request.Form("tekst_til_kol1"),"'","''")
kol2tekst = Replace(Request.Form("tekst_til_kol2"),"'","''")
kol3tekst = Replace(Request.Form("tekst_til_kol3"),"'","''")
kol4tekst = Replace(Request.Form("tekst_til_kol4"),"'","''")
kol5tekst = Replace(Request.Form("tekst_til_kol5"),"'","''")
if kol1tekst <> "" AND kol2tekst <> "" then
sql = "INSERT INTO lektier (dato, fag, lave, side, kilde) VALUES ('" & kol1tekst & "', '" & kol2tekst & "', '" & kol3tekst & "', '" & kol4tekst & "', '" & kol5tekst & "')"
Conn.execute(sql) 'Så er det gemt i databsen.
end if
end if
'Vis formen:
%><font size="2"></p>
</font></strong><p><small><input type="submit" value="Gem" name="B1"></small></p>
</a><div align="center"><center><table border="1" bgcolor="#A0B3C8" bordercolor="#000000"
height="71" width="875">
<tr>
<strong><td width="117" align="center" height="16"><small><font face="Arial">Billede</font></small></strong></td>
<td width="146" align="center" height="16"><a href="default1.asp?sort=navn"><font
face="Arial" color="#000000"><small>Navn</small></font></a></td>
<td width="49" align="center" height="16"><a href="default1.asp?sort=alder"><font
face="Arial" color="#000000"><small>Alder</small></font></a></td>
<td width="49" align="center" height="16"><a href="default1.asp?sort=klasse"><font
face="Arial" color="#000000"><small>Klasse</small></font></a></td>
<td width="49" align="center" height="16"><a href="default1.asp?sort=samlet"><font
face="Arial" color="#000000"><small>Samlet</small></font></a></td>
<td width="49" align="center" height="16"><a href="default1.asp?sort=patter"><font
face="Arial" color="#000000"><small>Patter</small></font></a></td>
<td width="49" align="center" height="16"><a href="default1.asp?sort=røv"><font
face="Arial" color="#000000"><small>Røv</small></font></a></td>
<td width="49" align="center" height="16"><a href="default1.asp?sort=krop"><font
face="Arial" color="#000000"><small>Krop</small></font></a></td>
<td width="50" align="center" height="16"><a href="default1.asp?sort=charme"><font
face="Arial" color="#000000"><small>Charme</small></font></a></td>
<td width="50" align="center" height="16"><a href="default1.asp?sort=aksp"><font
face="Arial" color="#000000"><small>AKSP</small></font></a></td>
<td width="189" align="center" height="16"><small><font face="Arial">Kommentar</font></small></td>
</tr>
<tr>
<strong><td width="117" height="19" align="center"></strong><a </tr><small><input
type="text" name="billede" size="12"></small></a><strong></strong></td>
<td width="146" height="19" align="center"><div align="left"><p><a </tr><small><input
type="text" name="navn" size="15"></small></a><strong></strong></td>
<td width="49" height="19" align="center"><a </tr><small><input type="text" name="alder"
size="3"></small></a></td>
<td width="49" height="19" align="center"><a </tr><small><input type="text" name="klasse"
size="3"></small></a><strong></strong></td>
<td width="49" height="19" align="center"><a </tr><small><input type="text" name="samlet"
size="3"></small></a><strong></strong></td>
<td width="49" height="19" align="center"><a </tr><small><input type="text" name="patter"
size="3"></small></a><strong></strong></td>
<td width="49" height="19" align="center"><a </tr><small><input type="text" name="roev"
size="3"></small></a><strong></strong></td>
<td width="49" height="19" align="center"><a </tr><small><input type="text" name="krop"
size="3"></small></a><strong></strong></td>
<td width="50" height="19" align="center"><a </tr><small><input type="text" name="cme"
size="3"></small></a><strong></strong></td>
<td width="50" height="19" align="center"><a </tr><small><input type="text" name="aksp"
size="3"></small></a><strong></strong></td>
<td width="189" height="19" align="center"><textarea rows="2" name="kommentar" cols="20"></textarea></td>
</tr>
</table>
</center></div><a </tr><p> </p>
</a><strong>
</form>
</strong></td>
</tr>
</table>
</center></div>
</body>
</html>
Hvis jeg gerne sætte de ting der bliver skrevet i tekstboksene ind i min db
Det er vel bare denne der skal laves om ikke ?
<%
'Tjek om form er send til seid så gem i databasen:
if request.servervariables("REQUEST_METHOD") = "POST" then
kol1tekst = Replace(Request.Form("tekst_til_kol1"),"'","''")
kol2tekst = Replace(Request.Form("tekst_til_kol2"),"'","''")
kol3tekst = Replace(Request.Form("tekst_til_kol3"),"'","''")
kol4tekst = Replace(Request.Form("tekst_til_kol4"),"'","''")
kol5tekst = Replace(Request.Form("tekst_til_kol5"),"'","''")
if kol1tekst <> "" AND kol2tekst <> "" then
sql = "INSERT INTO lektier (dato, fag, lave, side, kilde) VALUES ('" & kol1tekst & "', '" & kol2tekst & "', '" & kol3tekst & "', '" & kol4tekst & "', '" & kol5tekst & "')"
Conn.execute(sql) 'Så er det gemt i databsen.
end if
end if
'Vis formen:
%><
