Her er en kode som burde virker. Denne dato som lægges i er med PM/AM - sig til hvis du vil have det ændret.
Når du viser news skal du have denne kode i dit news felts content
Mvh
www.fotx.net/orca<% Response.write replace(rs(\"news\"), vbcrlf, \"<br>\") %>
Dette erstatter alle mellemrum med <br> så det vises korrekt. Hvis du har nogen spørgssmål så sig endelig til.
<HTML>
<HEAD>
<META NAME=\"GENERATOR\" Content=\"Microsoft Visual Studio 6.0\">
</HEAD>
<BODY>
<form method=get action=\"test.asp?mode=AddNew\" id=form name=form>
<font><STRONG><font face=arial size=3>Name</font></STRONG></font>
<br>
<INPUT id=name name=name size=\"25\">
<br>
<br>
<font><strong><font face=arial size=3>E-mail</font></strong></font>
<br>
<INPUT id=email name=email size=\"25\">
<br>
<br>
<font><strong><font face=arial size=3>News</font></strong></font>
<br>
<textarea id=news name=news size=\"25\"></textarea>
<br>
<br>
<P><INPUT type=\"submit\" value=\"Submit\" id=submit1 name=submit1></P>
<input type=\"hidden\" value=AddNew name=mode id=mode></form>
<%
if request(\"mode\") = \"AddNew\" then
%>
<%
strDate = month(date()) & \"/\" & day(date()) & \"/\" & year(date()) & \" - \" & hour(time()) & \":\" & minute(time()) & \" \" & funcGetPM(time())
function funcGetPM(myTime)
dim timetemp
timetemp = Cdate(\"12:00:01 PM\")
if mytime > timetemp then
funcGetPM = \"pm\"
else
funcGetPM = \"am\"
end if
end function
Set DataConn = Server.CreateObject(\"ADODB.Connection\")
DSN = \"DRIVER={Microsoft Access Driver (*.mdb)};uid=admin; \"
DSN = dsn & \"DBQ=\" & server.mappath(\"settings.mdb\")
DataConn.Open DSN
Set Record = Server.CreateObject(\"ADODB.RecordSet\")
Record.open \"Select * From [news] Order by id\", DataConn, 1, 3
Record.AddNew
Record.Fields(\"name\") = Request(\"name\")
Record.Fields(\"email\") = Request(\"email\")
Record.Fields(\"news\") = Request(\"news\")
Record.Fields(\"tidpostet\") = strDate \'----tiden news\'en er lavet----
Record.Fields(\"user_ip\") = Request(\"REMOTE_ADDR\")
Record.Update
Record.Close
set Record = nothing
Dataconn.Close
Response.Redirect(\"test.asp\")
%>
<%
end if
%>
</BODY>
</HTML>