28. august 2003 - 13:22
Der er
19 kommentarer og 1 løsning
2 script/sider til 1
jeg har 2 sider som jeg vil høre om nogle vil sætte sammen til 1 side. admin_opret_ram.asp (den side hvor man indtaster infoerne) <html> <head> <title></title> <LINK REL="StyleSheet" HREF="../../inklude/edbstyle.css" TYPE="text/css"> </head> <body bgcolor="#FFFFFF"> <form name="ram" action="opret_process_ram.asp" method="post"> <table width="420" cellpadding=2 cellspacing=0 align="center"> <tr> <td colspan=2 bgcolor="#000000" align="center" class="adminopretover"><b>RAM-blokke oplysninger</b></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Vare Nr.</b></td> <td align="left" valign="top"><input class="text" type="text" name="A" size="62" title="Evt. Rxxxxxx"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Producent</b></td> <td align="left" valign="top"><input class="text" type="text" name="B" size="62" title="Evt. Acer"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Model</b></td> <td align="left" valign="top"><input class="text" type="text" name="C" size="62" title="Evt. AL712"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Ram Type</b></td> <td align="left" valign="top"><input class="text" type="text" name="D" size="62" title="Evt. DDR-SDRam"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>PC str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="E" size="62" title="Evt. 2100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pins str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="F" size="62" title="Evt. 184"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Mb str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="G" size="62" title="Evt. 256"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Bit str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="H" size="62" title="Evt. 64bit(72bit)"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>NS hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="I" size="62" title="Evt. 7.5"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>MHz hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="J" size="62" title="Evt. 266"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Parts</b></td> <td align="left" valign="top"><input class="text" type="text" name="K" size="62" title="Evt. 3"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Billede</b></td> <td align="left" valign="top"><input class="text" type="text" name="L" size="62" title="Evt. billede.gif ELLERS N/A"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 1</b></td> <td align="left" valign="top"><input class="text" type="text" name="M" size="62" title="Evt. 100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 2</b></td> <td align="left" valign="top"><input class="text" type="text" name="N" size="62" title="Evt. 200 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 3</b></td> <td align="left" valign="top"><input class="text" type="text" name="O" size="62" title="Evt. 300 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Info</b></td> <td align="left" valign="top"><textarea rows="12" name="P" class="text" cols="65" title="Skriv en lille beskrivelse."></textarea></td> </tr> <tr> <td valign="top" align="right" height="2" ></td> <td height="2" align="left"><input name="lineBreak" type="hidden" id="lineBreak" value="true" checked></td> </tr> <tr> <td align="center" colspan=2><input class="Button" type="submit" value="Opret" accesskey="o" title="Genvejstast: Alt+O"></td> </tr> </table> </form> </body> </html> opret_process_ram.asp (Den side som gemmer dataen i en db) <!--#include file="accedbshop.asp"--> <% Dim AA, BB, CC, DD, EE, FF, GG, HH, II, JJ, KK, LL, MM, OO, PP, rsOpret Function OpretUpdate() AA = Request.Form("A") BB = Request.Form("B") CC = Request.Form("C") DD = Request.Form("D") EE = Request.Form("E") FF = Request.Form("F") GG = Request.Form("G") HH = Request.Form("H") II = Request.Form("I") JJ = Request.Form("J") KK = Request.Form("K") LL = Request.Form("L") MM = Request.Form("M") NN = Request.Form("N") OO = Request.Form("O") PP = Request.Form("P") If Request.Form("lineBreak") = "true" Then PP = Replace(PP, vbCrLf, "<br>") End If Set rsOpret = Server.CreateObject("ADODB.Recordset") rsOpret.open "Ram", cn, 3, 3 rsOpret.AddNew rsOpret("VNR") = AA rsOpret("FIRM") = BB rsOpret("MODEL") = CC rsOpret("TYPE") = DD rsOpret("PC") = EE rsOpret("PINS") = FF rsOpret("MB") = GG rsOpret("BIT") = HH rsOpret("LATENCY") = II rsOpret("SPEED") = JJ rsOpret("PARTS") = KK rsOpret("IMAGE") = LL rsOpret("PRICE1") = MM rsOpret("PRICE2") = NN rsOpret("PRICE3") = OO rsOpret("INFO") = PP rsOpret.Update rsOpret.close set rsOpret = nothing End Function OpretUpdate() %> <% cn.close set cn = nothing Response.Redirect("admin_opret_ram.asp") %>
Annonceindlæg fra Cognizant
28. august 2003 - 13:25
#1
Det er en meget individuel ting om man klumper sine ting sammen eller ej. Personligt benytter jeg altid en side til alle database operationer, og en side til input. Saa jeg ville ikke aendre ved det som du har.
28. august 2003 - 13:27
#2
<!--#include file="accedbshop.asp"--> <html> <head> <title></title> <LINK REL="StyleSheet" HREF="../../inklude/edbstyle.css" TYPE="text/css"> </head> <body bgcolor="#FFFFFF"> <form name="ram" action="admin_opret_ram.asp " method="post"> <table width="420" cellpadding=2 cellspacing=0 align="center"> <tr> <td colspan=2 bgcolor="#000000" align="center" class="adminopretover"><b>RAM-blokke oplysninger</b></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Vare Nr.</b></td> <td align="left" valign="top"><input class="text" type="text" name="A" size="62" title="Evt. Rxxxxxx"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Producent</b></td> <td align="left" valign="top"><input class="text" type="text" name="B" size="62" title="Evt. Acer"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Model</b></td> <td align="left" valign="top"><input class="text" type="text" name="C" size="62" title="Evt. AL712"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Ram Type</b></td> <td align="left" valign="top"><input class="text" type="text" name="D" size="62" title="Evt. DDR-SDRam"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>PC str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="E" size="62" title="Evt. 2100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pins str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="F" size="62" title="Evt. 184"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Mb str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="G" size="62" title="Evt. 256"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Bit str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="H" size="62" title="Evt. 64bit(72bit)"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>NS hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="I" size="62" title="Evt. 7.5"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>MHz hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="J" size="62" title="Evt. 266"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Parts</b></td> <td align="left" valign="top"><input class="text" type="text" name="K" size="62" title="Evt. 3"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Billede</b></td> <td align="left" valign="top"><input class="text" type="text" name="L" size="62" title="Evt. billede.gif ELLERS N/A"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 1</b></td> <td align="left" valign="top"><input class="text" type="text" name="M" size="62" title="Evt. 100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 2</b></td> <td align="left" valign="top"><input class="text" type="text" name="N" size="62" title="Evt. 200 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 3</b></td> <td align="left" valign="top"><input class="text" type="text" name="O" size="62" title="Evt. 300 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Info</b></td> <td align="left" valign="top"><textarea rows="12" name="P" class="text" cols="65" title="Skriv en lille beskrivelse."></textarea></td> </tr> <tr> <td valign="top" align="right" height="2" ></td> <td height="2" align="left"><input name="lineBreak" type="hidden" id="lineBreak" value="true" checked></td> </tr> <tr> <td align="center" colspan=2><input class="Button" name="submitside" type="submit" value="Opret" accesskey="o" title="Genvejstast: Alt+O"></td> </tr> </table> </form> </body> </html> <% if request.form ("submitside") <>"" then ' dette skal kun køres hvis der er submittet. Dim AA, BB, CC, DD, EE, FF, GG, HH, II, JJ, KK, LL, MM, OO, PP, rsOpret Function OpretUpdate() AA = Request.Form("A") BB = Request.Form("B") CC = Request.Form("C") DD = Request.Form("D") EE = Request.Form("E") FF = Request.Form("F") GG = Request.Form("G") HH = Request.Form("H") II = Request.Form("I") JJ = Request.Form("J") KK = Request.Form("K") LL = Request.Form("L") MM = Request.Form("M") NN = Request.Form("N") OO = Request.Form("O") PP = Request.Form("P") If Request.Form("lineBreak") = "true" Then PP = Replace(PP, vbCrLf, "<br>") End If Set rsOpret = Server.CreateObject("ADODB.Recordset") rsOpret.open "Ram", cn, 3, 3 rsOpret.AddNew rsOpret("VNR") = AA rsOpret("FIRM") = BB rsOpret("MODEL") = CC rsOpret("TYPE") = DD rsOpret("PC") = EE rsOpret("PINS") = FF rsOpret("MB") = GG rsOpret("BIT") = HH rsOpret("LATENCY") = II rsOpret("SPEED") = JJ rsOpret("PARTS") = KK rsOpret("IMAGE") = LL rsOpret("PRICE1") = MM rsOpret("PRICE2") = NN rsOpret("PRICE3") = OO rsOpret("INFO") = PP rsOpret.Update rsOpret.close set rsOpret = nothing End Function OpretUpdate() cn.close set cn = nothing end if %> //akj
28. august 2003 - 13:36
#3
URSUS Ja men problemmet er at så skal jeg have 2-4 sider x 20 og det vil jeg ikke, men ellers tak for din mening :) DK hvad med: <form name="ram" action="admin_opret_ram.asp " method="post"> !??
28. august 2003 - 14:38
#4
Jeg har normalt en side (DoAction.asp) som haandterer alle updates til DB'en per "modul". Derudover en side per "objekt" jeg haandterer. F.eks. en enkelt side til at vise/editere/indtaste ny en adresse. Saa det ender ikke med at bliver mere end 2 sider per modul. Hvis du benytter en enkelt side til en masse ting og derfor er noedt til at switche paa en masse input parametre for at finde ud af hvad siden skal goere, ender det ofte med at blive noget uoverskueligt rod. Men igen: "Opinions are like assholes, everybody's got one", og det her er bare min ;)
28. august 2003 - 15:11
#5
aero >> Hvad mener du med: <form name="ram".... ?? //akj
28. august 2003 - 15:26
#6
2-4 sider x 20 ???
28. august 2003 - 16:48
#7
DK Min fejl så ikke lige at du havde ændret linket til siden !!! sorry
28. august 2003 - 16:52
#8
DK har du tid til 2 sider mere !??
28. august 2003 - 16:53
#9
skal nok ligger flere p i !!
28. august 2003 - 21:02
#10
Ja, jeg tager den ene og du tager den anden... Så lærer du også noget... Du kan også sagtens selv lave det. 1 du kopier script fra modtagende side over i afsendene 2 ret action i <form> 3 indsæt "if request.form ("submitside") <>"" then ' dette skal kun køres hvis der er submittet." over det du indsatte fra modtagende side 4 afslut if sætningen nederst på siden. 5 det var det. Prøv selv, går det ikke skal jeg nok hjælpe. //akj
28. august 2003 - 21:10
#11
nej nej det er nemlig en update side nu !! det med opret side har jeg forstået og hvorfor du gør det men nu er det en opdater side !! CODE opdater_ram.asp (Den side der henter den enkelte ID frem) <!--#include file="accedbshop.asp"--> <% Dim rsOpdater sql = "Select * From Ram Where PID = " & Request.Querystring("id") Set rsOpdater = Server.CreateObject("ADODB.Recordset") rsOpdater.Open sql, cn, 3, 3 %> <%if Request.QueryString("updated") = "true" then%> <%end if%> <html> <head> <LINK REL="StyleSheet" HREF="../../inklude/edbstyle.css" TYPE="text/css"> </head> <body> <form name="ramform" action="ram_update.asp" method="post"> <table width="420" cellpadding=2 cellspacing=0 align="center"> <tr> <td colspan=2 bgcolor="#000000" align="center" class="adminopretover"><b>RAM-blokke oplysninger</b></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Vare Nr.</b></td> <td align="left" valign="top"><input class="text" type="text" name="A" size="62" value="<%=rsOpdater("VNR")%>" title="Evt. Rxxxxxx"><input type="hidden" name="id" value="<%=rsOpdater("PID")%>"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Producent</b></td> <td align="left" valign="top"><input class="text" type="text" name="B" size="62" value="<%=rsOpdater("FIRM")%>" title="Evt. Acer"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Model</b></td> <td align="left" valign="top"><input class="text" type="text" name="C" size="62" value="<%=rsOpdater("MODEL")%>" title="Evt. AL712"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Ram Type</b></td> <td align="left" valign="top"><input class="text" type="text" name="D" size="62" value="<%=rsOpdater("TYPE")%>" title="Evt. DDR-SDRam"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>PC str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="E" size="62" value="<%=rsOpdater("PC")%>" title="Evt. 2100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pins str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="F" size="62" value="<%=rsOpdater("PINS")%>" title="Evt. 184"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Mb str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="G" size="62" value="<%=rsOpdater("MB")%>" title="Evt. 256"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Bit str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="H" size="62" value="<%=rsOpdater("BIT")%>" title="Evt. 64bit(72bit)"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>NS hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="I" size="62" value="<%=rsOpdater("LATENCY")%>" title="Evt. 7.5"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>MHz hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="J" size="62" value="<%=rsOpdater("SPEED")%>" title="Evt. 266"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Parts</b></td> <td align="left" valign="top"><input class="text" type="text" name="K" size="62" value="<%=rsOpdater("PARTS")%>" title="Evt. 3"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Billede</b></td> <td align="left" valign="top"><input class="text" type="text" name="L" size="62" value="<%=rsOpdater("IMAGE")%>" title="Evt. billede.gif ELLERS N/A"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 1</b></td> <td align="left" valign="top"><input class="text" type="text" name="M" size="62" value="<%=rsOpdater("PRICE1")%>" title="Evt. 100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 2</b></td> <td align="left" valign="top"><input class="text" type="text" name="N" size="62" value="<%=rsOpdater("PRICE2")%>" title="Evt. 200 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 3</b></td> <td align="left" valign="top"><input class="text" type="text" name="O" size="62" value="<%=rsOpdater("PRICE3")%>" title="Evt. 300 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Info</b></td> <td align="left" valign="top"><textarea rows="12" name="P" class="text" cols="65" title="Skriv en lille beskrivelse."><%=rsOpdater("INFO")%></textarea></td> </tr> <tr> <td align="center" colspan=2><input class="Button" type="submit" name="submitbutton" value="Updater" accesskey="u" title="Genvejstast: Alt+U"></td> </tr> </table> </form> </font> </body> </html> <% rsOpdater.close set rsOpdater = nothing cn.close set cn = nothing %> </font> </body> </html> ram_update.asp (Den side der gemmer dataen igen) <!--#include file="accedbshop.asp"--> <% Dim AA, BB, CC, DD, EE, FF, GG, HH, II, JJ, KK, LL, MM, OO, PP, rsOpret Function OpdaterUpdate() ID = Request.Form("id") AA = Request.Form("A") BB = Request.Form("B") CC = Request.Form("C") DD = Request.Form("D") EE = Request.Form("E") FF = Request.Form("F") GG = Request.Form("G") HH = Request.Form("H") II = Request.Form("I") JJ = Request.Form("J") KK = Request.Form("K") LL = Request.Form("L") MM = Request.Form("M") NN = Request.Form("N") OO = Request.Form("O") PP = Request.Form("P") Set rsOpdater = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM Ram WHERE PID=" & ID rsOpdater.open strSQL, cn, 2, 3 rsOpdater("VNR") = AA rsOpdater("FIRM") = BB rsOpdater("MODEL") = CC rsOpdater("TYPE") = DD rsOpdater("PC") = EE rsOpdater("PINS") = FF rsOpdater("MB") = GG rsOpdater("BIT") = HH rsOpdater("LATENCY") = II rsOpdater("SPEED") = JJ rsOpdater("PARTS") = KK rsOpdater("IMAGE") = LL rsOpdater("PRICE1") = MM rsOpdater("PRICE2") = NN rsOpdater("PRICE3") = OO rsOpdater("INFO") = PP rsOpdater.Update rsOpdater.close set rsOpdater = nothing End Function OpdaterUpdate() %> <% cn.close set cn = nothing Response.Redirect("admin_opret_ram.asp") %>
29. august 2003 - 08:16
#12
På samme måde... opdater_ram.asp (Den side der henter den enkelte ID frem) <!--#include file="accedbshop.asp"--> <% Dim rsOpdater sql = "Select * From Ram Where PID = " & Request.Querystring("id") Set rsOpdater = Server.CreateObject("ADODB.Recordset") rsOpdater.Open sql, cn, 3, 3 %> <%if Request.QueryString("updated") = "true" then%> <%end if%> <html> <head> <LINK REL="StyleSheet" HREF="../../inklude/edbstyle.css" TYPE="text/css"> </head> <body> <form name="ramform" action="opdater_ram.asp" method="post"> <table width="420" cellpadding=2 cellspacing=0 align="center"> <tr> <td colspan=2 bgcolor="#000000" align="center" class="adminopretover"><b>RAM-blokke oplysninger</b></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Vare Nr.</b></td> <td align="left" valign="top"><input class="text" type="text" name="A" size="62" value="<%=rsOpdater("VNR")%>" title="Evt. Rxxxxxx"><input type="hidden" name="id" value="<%=rsOpdater("PID")%>"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Producent</b></td> <td align="left" valign="top"><input class="text" type="text" name="B" size="62" value="<%=rsOpdater("FIRM")%>" title="Evt. Acer"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Model</b></td> <td align="left" valign="top"><input class="text" type="text" name="C" size="62" value="<%=rsOpdater("MODEL")%>" title="Evt. AL712"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Ram Type</b></td> <td align="left" valign="top"><input class="text" type="text" name="D" size="62" value="<%=rsOpdater("TYPE")%>" title="Evt. DDR-SDRam"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>PC str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="E" size="62" value="<%=rsOpdater("PC")%>" title="Evt. 2100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pins str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="F" size="62" value="<%=rsOpdater("PINS")%>" title="Evt. 184"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Mb str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="G" size="62" value="<%=rsOpdater("MB")%>" title="Evt. 256"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Bit str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="H" size="62" value="<%=rsOpdater("BIT")%>" title="Evt. 64bit(72bit)"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>NS hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="I" size="62" value="<%=rsOpdater("LATENCY")%>" title="Evt. 7.5"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>MHz hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="J" size="62" value="<%=rsOpdater("SPEED")%>" title="Evt. 266"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Parts</b></td> <td align="left" valign="top"><input class="text" type="text" name="K" size="62" value="<%=rsOpdater("PARTS")%>" title="Evt. 3"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Billede</b></td> <td align="left" valign="top"><input class="text" type="text" name="L" size="62" value="<%=rsOpdater("IMAGE")%>" title="Evt. billede.gif ELLERS N/A"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 1</b></td> <td align="left" valign="top"><input class="text" type="text" name="M" size="62" value="<%=rsOpdater("PRICE1")%>" title="Evt. 100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 2</b></td> <td align="left" valign="top"><input class="text" type="text" name="N" size="62" value="<%=rsOpdater("PRICE2")%>" title="Evt. 200 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 3</b></td> <td align="left" valign="top"><input class="text" type="text" name="O" size="62" value="<%=rsOpdater("PRICE3")%>" title="Evt. 300 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Info</b></td> <td align="left" valign="top"><textarea rows="12" name="P" class="text" cols="65" title="Skriv en lille beskrivelse."><%=rsOpdater("INFO")%></textarea></td> </tr> <tr> <td align="center" colspan=2><input class="Button" type="submit" name="submitbutton" value="Updater" accesskey="u" title="Genvejstast: Alt+U"></td> </tr> </table> </form> </font> </body> </html> <% rsOpdater.close set rsOpdater = nothing cn.close set cn = nothing %> </font> </body> </html> <% if request.form("submitbutton") <> "" then Dim AA, BB, CC, DD, EE, FF, GG, HH, II, JJ, KK, LL, MM, OO, PP, rsOpret Function OpdaterUpdate() ID = Request.Form("id") AA = Request.Form("A") BB = Request.Form("B") CC = Request.Form("C") DD = Request.Form("D") EE = Request.Form("E") FF = Request.Form("F") GG = Request.Form("G") HH = Request.Form("H") II = Request.Form("I") JJ = Request.Form("J") KK = Request.Form("K") LL = Request.Form("L") MM = Request.Form("M") NN = Request.Form("N") OO = Request.Form("O") PP = Request.Form("P") Set rsOpdater = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM Ram WHERE PID=" & ID rsOpdater.open strSQL, cn, 2, 3 rsOpdater("VNR") = AA rsOpdater("FIRM") = BB rsOpdater("MODEL") = CC rsOpdater("TYPE") = DD rsOpdater("PC") = EE rsOpdater("PINS") = FF rsOpdater("MB") = GG rsOpdater("BIT") = HH rsOpdater("LATENCY") = II rsOpdater("SPEED") = JJ rsOpdater("PARTS") = KK rsOpdater("IMAGE") = LL rsOpdater("PRICE1") = MM rsOpdater("PRICE2") = NN rsOpdater("PRICE3") = OO rsOpdater("INFO") = PP rsOpdater.Update rsOpdater.close set rsOpdater = nothing End Function OpdaterUpdate() cn.close set cn = nothing end if %>
29. august 2003 - 14:03
#14
Det er fordi du viser din vare med id fra url. Du skal gemme det id (i dette tilfælde 5) i en <hidden> <!--#include file="accedbshop.asp"--> <% Dim rsOpdater id = Request.Querystring("id") if id = "" then id = request.form("varenummer") ' tag fra hidden hvis siden er submittet end if sql = "Select * From Ram Where PID = " & Set rsOpdater = Server.CreateObject("ADODB.Recordset") rsOpdater.Open sql, cn, 3, 3 %> <%if Request.QueryString("updated") = "true" then%> <%end if%> <html> <head> <LINK REL="StyleSheet" HREF="../../inklude/edbstyle.css" TYPE="text/css"> </head> <body> <form name="ramform" action="opdater_ram.asp" method="post"> <input type=hidden name="varenummer" value="<%=id%>"> <table width="420" cellpadding=2 cellspacing=0 align="center"> <tr> <td colspan=2 bgcolor="#000000" align="center" class="adminopretover"><b>RAM-blokke oplysninger</b></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Vare Nr.</b></td> <td align="left" valign="top"><input class="text" type="text" name="A" size="62" value="<%=rsOpdater("VNR")%>" title="Evt. Rxxxxxx"><input type="hidden" name="id" value="<%=rsOpdater("PID")%>"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Producent</b></td> <td align="left" valign="top"><input class="text" type="text" name="B" size="62" value="<%=rsOpdater("FIRM")%>" title="Evt. Acer"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Model</b></td> <td align="left" valign="top"><input class="text" type="text" name="C" size="62" value="<%=rsOpdater("MODEL")%>" title="Evt. AL712"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Ram Type</b></td> <td align="left" valign="top"><input class="text" type="text" name="D" size="62" value="<%=rsOpdater("TYPE")%>" title="Evt. DDR-SDRam"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>PC str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="E" size="62" value="<%=rsOpdater("PC")%>" title="Evt. 2100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pins str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="F" size="62" value="<%=rsOpdater("PINS")%>" title="Evt. 184"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Mb str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="G" size="62" value="<%=rsOpdater("MB")%>" title="Evt. 256"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Bit str.</b></td> <td align="left" valign="top"><input class="text" type="text" name="H" size="62" value="<%=rsOpdater("BIT")%>" title="Evt. 64bit(72bit)"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>NS hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="I" size="62" value="<%=rsOpdater("LATENCY")%>" title="Evt. 7.5"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>MHz hastighed</b></td> <td align="left" valign="top"><input class="text" type="text" name="J" size="62" value="<%=rsOpdater("SPEED")%>" title="Evt. 266"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Parts</b></td> <td align="left" valign="top"><input class="text" type="text" name="K" size="62" value="<%=rsOpdater("PARTS")%>" title="Evt. 3"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Billede</b></td> <td align="left" valign="top"><input class="text" type="text" name="L" size="62" value="<%=rsOpdater("IMAGE")%>" title="Evt. billede.gif ELLERS N/A"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 1</b></td> <td align="left" valign="top"><input class="text" type="text" name="M" size="62" value="<%=rsOpdater("PRICE1")%>" title="Evt. 100"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 2</b></td> <td align="left" valign="top"><input class="text" type="text" name="N" size="62" value="<%=rsOpdater("PRICE2")%>" title="Evt. 200 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Pris 3</b></td> <td align="left" valign="top"><input class="text" type="text" name="O" size="62" value="<%=rsOpdater("PRICE3")%>" title="Evt. 300 ELLERS 0"></td> </tr> <tr> <td align="left" valign="top" class="adminopret"><b>Info</b></td> <td align="left" valign="top"><textarea rows="12" name="P" class="text" cols="65" title="Skriv en lille beskrivelse."><%=rsOpdater("INFO")%></textarea></td> </tr> <tr> <td align="center" colspan=2><input class="Button" type="submit" name="submitbutton" value="Updater" accesskey="u" title="Genvejstast: Alt+U"></td> </tr> </table> </form> </font> </body> </html> <% rsOpdater.close set rsOpdater = nothing cn.close set cn = nothing %> </font> </body> </html> <% if request.form("submitbutton") <> "" then Dim AA, BB, CC, DD, EE, FF, GG, HH, II, JJ, KK, LL, MM, OO, PP, rsOpret Function OpdaterUpdate() ID = Request.Form("id") AA = Request.Form("A") BB = Request.Form("B") CC = Request.Form("C") DD = Request.Form("D") EE = Request.Form("E") FF = Request.Form("F") GG = Request.Form("G") HH = Request.Form("H") II = Request.Form("I") JJ = Request.Form("J") KK = Request.Form("K") LL = Request.Form("L") MM = Request.Form("M") NN = Request.Form("N") OO = Request.Form("O") PP = Request.Form("P") Set rsOpdater = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM Ram WHERE PID=" & ID rsOpdater.open strSQL, cn, 2, 3 rsOpdater("VNR") = AA rsOpdater("FIRM") = BB rsOpdater("MODEL") = CC rsOpdater("TYPE") = DD rsOpdater("PC") = EE rsOpdater("PINS") = FF rsOpdater("MB") = GG rsOpdater("BIT") = HH rsOpdater("LATENCY") = II rsOpdater("SPEED") = JJ rsOpdater("PARTS") = KK rsOpdater("IMAGE") = LL rsOpdater("PRICE1") = MM rsOpdater("PRICE2") = NN rsOpdater("PRICE3") = OO rsOpdater("INFO") = PP rsOpdater.Update rsOpdater.close set rsOpdater = nothing End Function OpdaterUpdate() cn.close set cn = nothing end if %>
29. august 2003 - 14:57
#15
02. september 2003 - 09:45
#16
Dit link virker ikke.. Mit eksempel burde virke med både id 3 og 5 //akj
05. september 2003 - 16:49
#17
nej linket virker ikke fordi jeg ikke har været på!!
06. september 2003 - 09:54
#18
Har du fået det til at virke eller... //akj
06. september 2003 - 10:15
#19
ja lavede noget selv som ser lidt ud som dit bare en anden code opbygning !! men tak !!
08. september 2003 - 10:38
#20
selvtak. //akj
Kurser inden for grundlæggende programmering