<% 'öppna databasen Set Databas = Server.CreateObject( "Adodb.Connection" ) Databas.Provider = "Microsoft.Jet.OLEDB.4.0" MdbFilePath = Server.MapPath("db\theDB.mdb") Databas.ConnectionString = "Data Source='" & MdbFilePath & "'" Databas.open %>
<% 'hämta namnet på menyn SQL = "SELECT * From table1 WHERE theID = " & 39 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write " " &RecSet("theOtherPic") & "
" RecSet.Close Set RecSet = nothing %> <% 'hämta ev undermenyer if request.querystring("id") = 39 OR request.querystring("subid") = 39 then SQL = "SELECT * From table1 WHERE subID = " & 39 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) Do Until RecSet.EOF if RecSet.EOF then response.write "" end if response.write "   " &RecSet("theOtherPic") & "
" RecSet.MoveNext Loop RecSet.Close Set RecSet = nothing end if %> <% 'hämta namnet på menyn SQL = "SELECT * From table1 WHERE theID = " & 40 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write "
" &RecSet("theOtherPic") & "
" RecSet.Close Set RecSet = nothing %> <% if request.querystring("id") = 40 OR request.querystring("subid") = 40 then SQL = "SELECT * From table1 WHERE subID = " & 40 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) Do Until RecSet.EOF if RecSet.EOF then response.write "" end if response.write "   " &RecSet("theOtherPic") & "
" RecSet.MoveNext Loop RecSet.Close Set RecSet = nothing end if %> <% 'hästar response.write "
Hästar
" if request.querystring("id") = 41 OR request.querystring("subid") = 41 then response.write "   Ettåringar
   Tvååringar
   Treåringar
   Fyraåringar
   Femåringar och äldre" end if %> <% 'hämta namnet på menyn SQL = "SELECT * From table1 WHERE theID = " & 42 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write "
" &RecSet("theOtherPic") & "
" RecSet.Close Set RecSet = nothing %><% if request.querystring("id") = 42 OR request.querystring("subid") = 42 then SQL = "SELECT * From table1 WHERE subID = " & 42 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) Do Until RecSet.EOF if RecSet.EOF then response.write "" end if response.write "   " &RecSet("theOtherPic") & "
" RecSet.MoveNext Loop RecSet.Close Set RecSet = nothing end if %> <% 'hämta namnet på menyn SQL = "SELECT * From table1 WHERE theID = " & 43 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write "
" &RecSet("theOtherPic") & "
" RecSet.Close Set RecSet = nothing %><% if request.querystring("id") = 43 OR request.querystring("subid") = 43 then SQL = "SELECT * From table1 WHERE subID = " & 43 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) Do Until RecSet.EOF if RecSet.EOF then response.write "" end if response.write "   " &RecSet("theOtherPic") & "
" RecSet.MoveNext Loop RecSet.Close Set RecSet = nothing end if %>
Gästbok
<% 'starter response.write "
Starter
" if request.querystring("id") = 45 OR request.querystring("subid") = 45 then response.write "   Sverige
   Frankrike
" end if %> <% 'hämta namnet på menyn SQL = "SELECT * From table1 WHERE theID = " & 46 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write "
" &RecSet("theOtherPic") & "
" RecSet.Close Set RecSet = nothing %> <% if request.querystring("id") = 46 OR request.querystring("subid") = 46 then SQL = "SELECT * From table1 WHERE subID = " & 46 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) Do Until RecSet.EOF if RecSet.EOF then response.write "" end if response.write "   " &RecSet("theOtherPic") & "
" RecSet.MoveNext Loop RecSet.Close Set RecSet = nothing end if %> <% 'hämta namnet på menyn SQL = "SELECT * From table1 WHERE theID = " & 47 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write "
" &RecSet("theOtherPic") & "
" RecSet.Close Set RecSet = nothing %> <% if request.querystring("id") = 47 OR request.querystring("subid") = 47 then SQL = "SELECT * From table1 WHERE subID = " & 47 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) Do Until RecSet.EOF if RecSet.EOF then response.write "" end if response.write "   " &RecSet("theOtherPic") & "
" RecSet.MoveNext Loop RecSet.Close Set RecSet = nothing end if %> <% 'hämta namnet på menyn SQL = "SELECT * From table1 WHERE theID = " & 104 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write "
" &RecSet("theOtherPic") & "
" RecSet.Close Set RecSet = nothing %> <% if request.querystring("id") = 104 OR request.querystring("subid") = 104 then SQL = "SELECT * From table1 WHERE subID = " & 104 & " " Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) Do Until RecSet.EOF if RecSet.EOF then response.write "" end if response.write "   " &RecSet("theOtherPic") & "
" RecSet.MoveNext Loop RecSet.Close Set RecSet = nothing end if %>
Nyhetsarkiv


Gästbok
<% If Request.Querystring("skickat") = "ja" then %> <% if request.form("spm") = "Jörgen" then SQL = "INSERT INTO gb " SQL = SQL & "(gbName, gbEmail, gbText, gbDate) " SQL = SQL & "VALUES('" & inputfix(Request.form("gbName")) & "', '" & inputfix(Request.form("gbEmail")) & "', '" & inputfix(Request.form("gbText")) & "', #" & Request.form("gbDate") & "# )" Databas.Execute(SQL) 'skicka ett mail 'set msg = Server.CreateOBject( "JMail.Message" ) 'msg.Logging = true 'msg.silent = true 'msg.From = "info@stalljohannilsson.se" 'msg.FromName = "Gästboken" 'msg.AddRecipient "info@stalljohannilsson.se", "Johan Nilsson" 'msg.Subject = "Nytt meddelande i Gästboken!" 'msg.Body = "Du har fått ett nytt meddelande i gästboken!" 'msg.Send("mail.stalljohannilsson.se") 'Set msg = nothing else %> <% response.end end if Response.Redirect ("gb.asp") %> <% Else %>
Namn:
E-post:
Meddelande:
Spamkontroll: Vad heter sajtägaren i förnamn?
<% 'hämta inläggen SQL = "SELECT * From gb ORDER BY gbID DESC" Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) if RecSet.EOF then response.write "

Inga inlägg ännu

" end if Do Until RecSet.EOF response.write "
Namn: " & RecSet("gbName") if NOT RecSet("gbEmail") = "" then response.write " email" else response.write "" end if response.write "
Meddelande: " response.write textfix(RecSet("gbText")) response.write "
" & left(RecSet("gbDate"),11) &"" RecSet.MoveNext Loop RecSet.Close Set RecSet = nothing %>
Nyheter <% SQL = "SELECT TOP 3 * From table1 WHERE theType='news' ORDER BY theDate DESC" Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) Do Until RecSet.EOF response.write "" RecSet.MoveNext Loop RecSet.Close set RecSet = nothing %>
"&left(RecSet("theDate"),11)&" | " & left(RecSet("theText"),120) & " Läs mer
<% SQL = "SELECT * From table1 WHERE theType='banner1'" Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write " " RecSet.Close set RecSet = nothing SQL = "SELECT * From table1 WHERE theType='banner2'" Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write " " RecSet.Close set RecSet = nothing SQL = "SELECT * From table1 WHERE theType='banner3'" Databas.Execute( SQL ) set RecSet=Databas.execute(SQL) response.write " " RecSet.Close set RecSet = nothing %>
<% end if Databas.Close set Databas = nothing 'stänger databasen för hela sidan %>