hjælp til Data udtræk
Hvem kan hjælpe mig ??Jeg har denne side http://remo.lir.dk/demo
Klik på nøgle.
Log dig på som admin i brugernavn & password.
klik på admin-sektionen her bliver vist de poster som man kan rette i. problemet er at når jeg klikker på en post kommer der en blank side, her skullle min redigerinfo.asp komme istedet.
Hvem kan hjælpe mig.??
admin.asp
<!-- #include file="../databaseforbindelse.asp" -->
<!-- #include file="headerinfo.asp" -->
<%
' Hvis man ikke har admin-status, kan man ikke bruge denne side:
if session("status") <> "admin" then
response.write "Du skal have admin status, for at kunne bruge denne side!<br>"
response.write "Gå til <a href=""default.asp?emne=login"">login</a> siden."
response.end
end if
'dim conn, dsn, rs, sql
Set Conn = Server.CreateObject("ADODB.Connection")
'DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
'DSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("./db/brugerinfo.mdb")
'DSN = DSN & "DBQ=" & Server.MapPath("../db/brugerinfo.mdb")
Conn.Open DSN
sql = "select * from tblBrugerInfo order by admin, id asc"
set rs = conn.execute(sql)
if rs.eof then
response.write "Ingen brugere i databasen"
else
%>
<table border="0">
<tr>
<td>Id</td>
<td>Brugernavn</td>
<td>Kodeord</td>
<td>Navn</td>
</tr>
<%
do while not rs.eof
%>
<tr>
<td><a href="default.asp?emne=admin&emne2=retinfo&id=<%=rs("id")%>"><%=rs("id")%></a> </td>
<td><a href="redigerinfo.asp?mode=admin&id=<%=rs("id")%>"><%=rs("brugernavn")%></a> </td>
<td><a href="redigerinfo.asp?mode=admin&id=<%=rs("id")%>"><%=rs("kodeord")%></a> </td>
<td><a href="redigerinfo.asp?mode=admin&id=<%=rs("id")%>"><%=rs("navn")%></a> </td>
</tr>
<%
rs.movenext
loop
%>
</table>
<%
Conn.Close
set rs = nothing
Set Conn = Nothing
end if
%>
redigerinfo.asp
<%
'option explicit
response.buffer = true
' Hvis man ikke er logget ind, skal man ikke kunne se denne side
if session("id") = "" then response.redirect "../default.asp?emne=login"
%>
<!-- #include file="../databaseforbindelse.asp" -->
<!-- #include file="headerinfo.asp" -->
<!-- HUSK DOCTYPE -->
<html>
<head>
<title>Rediger info</title>
</head>
<body>
<%
function fixtegn(s)
fixtegn = replace(s, "'", "''")
end function
dim opdateret
opdateret = ""
dim brugerid
brugerid = CInt(session("id"))
'dim isAdmin, isSynlig
isAdmin = false
isSynlig = ""
if request.querystring("mode") = "admin" then
if session("status") <> "admin" then
response.redirect "../default.asp?emne=login"
else
brugerid = request.querystring("id")
isAdmin = true
end if
end if
'dim conn, dsn, rs, sql
'Set Conn = Server.CreateObject("ADODB.Connection")
'DSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("./db/brugerinfo.mdb")
'Conn.Open DSN
if request.servervariables("request_method") = "POST" then
' der skal opdateres
navn = fixtegn(request.form("navn"))
adresse = fixtegn(request.form("adresse"))
postnr = fixtegn(request.form("postnr"))
city = fixtegn(request.form("city"))
tlf = fixtegn(request.form("tlf"))
mobil = fixtegn(request.form("mobil"))
email = fixtegn(request.form("email"))
web = fixtegn(request.form("web"))
sted = fixtegn(request.form("sted"))
lp = fixtegn(request.form("lp"))
nyd = fixtegn(request.form("nyd"))
pic1 = fixtegn(request.form("pic1"))
pic2 = fixtegn(request.form("pic2"))
pic3 = fixtegn(request.form("pic3"))
tekst = fixtegn(request.form("tekst"))
brugernavn = fixtegn(request.form("brugernavn"))
kodeord = fixtegn(request.form("kodeord"))
dim sqlSynlig
sqlSynlig = "0"
if request.form("synlig") <> "" then sqlSynlig = "1"
sql = "update tblBrugerInfo set "
sql = sql & "navn = '" & navn & "', "
sql = sql & "adresse = '" & adresse & "', "
sql = sql & "postnr = '" & postnr & "', "
sql = sql & "city = '" & city & "', "
sql = sql & "tlf = '" & tlf & "', "
sql = sql & "mobil = '" & mobil & "', "
sql = sql & "email = '" & email & "', "
sql = sql & "web = '" & web & "', "
sql = sql & "sted = '" & sted & "', "
sql = sql & "lp = '" & lp & "', "
sql = sql & "nyd = '" & nyd & "', "
sql = sql & "pic1 = '" & pic1 & "', "
sql = sql & "pic2 = '" & pic2 & "', "
sql = sql & "pic3 = '" & pic3 & "', "
sql = sql & "tekst = '" & tekst & "', "
sql = sql & "brugernavn = '" & brugernavn & "', "
sql = sql & "kodeord = '" & kodeord & "', "
sql = sql & "synlig = " & sqlSynlig & " "
sql = sql & "where id = " & brugerid
conn.execute(sql)
opdateret = "<br><b>Profilen er nu opdateret</b>"
response.redirect "../default.asp?emne=admin"
end if
' der skal hentes
'dim fejl
fejl = false
sql = "select * from tblBrugerInfo where id = " & brugerid
set rs = conn.execute(sql)
dim navn, adresse, postnr, city, tlf, mobil, email, web, sted, lp, nyd, pic1, pic2, pic3, tekst
if not rs.eof then
navn = "" & rs("navn")
adresse = "" & rs("adresse")
postnr = "" & rs("postnr")
city = "" & rs("city")
tlf = "" & rs("tlf")
mobil = "" & rs("mobil")
email = "" & rs("email")
web = "" & rs("web")
sted = "" & rs("sted")
lp = "" & rs("lp")
nyd = "" & rs("nyd")
pic1 = "" & rs("pic1")
pic2 = "" & rs("pic2")
pic3 = "" & rs("pic3")
tekst = "" & rs("tekst")
brugernavn = "" & rs("brugernavn")
kodeord = "" & rs("kodeord")
if isAdmin then
if CBool(rs("synlig")) then isSynlig = " checked"
end if
else
fejl = true
end if
Conn.Close
set rs = nothing
Set Conn = Nothing
if fejl = true then response.redirect "login.asp"
%>
<center>
<Form Action="admin/redigerinfo.asp<% if request.querystring <> "" then response.write "?" & request.querystring%>" method="post">
<table cellspacing=0 border=0 cellspacing="0" cellpadding="5" width=320>
<tr>
<td colspan=2 height=20 width="310">
<b>Ret Oplysninger:</b>
</td>
</tr>
<tr>
<td width="64">
Navn</td>
<td align=right width="236">
<input type="text" name="navn" size="32" value="<%=navn%>"></td>
</tr>
<tr>
<td width="64">
Adresse</td>
<td align=right width="236">
<input type="text" name="adresse" size="32" value="<%=adresse%>"></td>
</tr>
<tr>
<td width="64">
Postnr</td>
<td align=right width="236">
<input type="text" name="postnr" size="32" value="<%=postnr%>"></td>
</tr>
<tr>
<td width="64">
By</td>
<td align=right width="236">
<input type="text" name="city" size="32" value="<%=city%>"></td>
</tr>
<tr>
<td width="64">
Tlf</td>
<td align=right width="236">
<input type="text" name="tlf" size="32" value="<%=tlf%>"></td>
</tr>
<tr>
<td width="64">
Mobil</td>
<td align=right width="236">
<input type="text" name="mobil" size="32" value="<%=mobil%>"></td>
</tr>
<tr>
<td width="64">
Email</td>
<td align=right width="236">
<input type="text" name="email" size="32" value="<%=email%>"></td>
</tr>
<tr>
<td width="64">
Web</td>
<td align=right width="236">
<input type="text" name="web" size="32" value="<%=web%>"></td>
</tr>
<tr>
<td width="64">
Sted</td>
<td align=right width="236">
<input type="text" name="sted" size="32" value="<%=sted%>"></td>
</tr>
<tr>
<td width="64">
Lp</td>
<td align=right width="236">
<input type="text" name="lp" size="32" value="<%=lp%>"></td>
</tr>
<tr>
<td width="64">
Nyd</td>
<td align=right width="236">
<input type="text" name="nyd" size="32" value="<%=nyd%>"></td>
</tr>
<tr>
<td width="64">
Pic1</td>
<td align=right width="236">
<input type="text" name="pic1" size="32" value="<%=pic1%>"></td>
</tr>
<tr>
<td width="64">
Pic2</td>
<td align=right width="236">
<input type="text" name="pic2" size="32" value="<%=pic2%>"></td>
</tr>
<tr>
<td width="64">
Pic3</td>
<td align=right width="236">
<input type="text" name="pic3" size="32" value="<%=pic3%>"></td>
</tr>
<tr>
<td width="64">
tekst</td>
<td align=right width="236">
<textarea rows="12" name="tekst" cols="28"><%=tekst%></textarea></td>
</tr>
<tr>
<td width="64">
Brugernavn</td>
<td align=right width="236">
<input type="text" name="brugernavn" size="32" value="<%=brugernavn%>"></td>
</tr>
<tr>
<td width="64">
Kodeord</td>
<td align=right width="236">
<input type="text" name="kodeord" size="32" value="<%=kodeord%>"></td>
</tr>
<% if isAdmin then %>
<tr>
<td colspan=2 width="310">
<Div Align=right>Synlig:
<Input type="checkbox" name="synlig"<%=isSynlig%> value="ON"></div>
</td>
</tr>
<% end if %>
<tr>
<td colspan=2 width="310">
<Div Align=right><Input type="submit" Value="Ret"></div>
</td>
</tr>
</table>
</form>
<%=opdateret%>
</BODY>
</HTML>
index.asp
<!-- #include file="headerinfo.asp" -->
<% if session("id") = "" then %>
<!-- her kan du putte ting der skal vises, hvis man IKKE er logget ind -->
<a href="login.asp">login</a>
<% end if %>
<%
if session("id") <> "" then
%>
<!-- her kan du putte ting der skal vises, hvis man ER logget ind -->
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%">
<tr>
<td width="100%" class="topbar" align="center">Administrator siden</td>
</tr>
<tr>
<td width="100%">Velkommen til administrator siden. På denne side kan du
rette i dine oplysninger, uploade billeder til dit visitkort, tilføje
guldkorn til hjemmesiden, oprette annonce til køb/salg.</td>
</tr>
<tr>
<td width="100%" align="center"> <a href="default.asp?emne=admin&emne2=retinfo">Rediger info</a> |
<a href="default.asp?emne=admin&emne2=guldkorn">Tilføje Guldkorn</a>| <a href="default.asp?emne=admin&emne2=uppic">Upload billeder</a> | Køb/Salg |
<a href="admin/logout.asp">Log ud</a> |<% if session("status") = "admin" then %>
<a href="default.asp?emne=admin&emne2=admin">admin-sektionen</a>|<a href="default.asp?emne=admin&emne2=tfk">tilføj kalender</a>|<a href="default.asp?emne=admin&emne2=updoc"> upload doc</a>|
<% end if %><% end if %></td>
</tr>
</table>
<br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%">
<tr>
<td width="100%">
<% if Trim(Request.QueryString("emne2")) = "retinfo" then %>
<!--#include file="redigerinfo.asp" -->
<%end if%>
<% if Trim(Request.QueryString("emne2")) = "admin" then %>
<!--#include file="admin.asp" -->
<%end if%>
<% if Trim(Request.QueryString("emne2")) = "guldkorn" then %>
<!--#include file="upcitat.asp" -->
<%end if%>
<% if Trim(Request.QueryString("emne2")) = "uppic" then %>
<!--#include file="uploadgfx.asp" -->
<%end if%>
<% if Trim(Request.QueryString("emne2")) = "tfk" then %>
<!--#include file="upkal.asp" -->
<%end if%>
<% if Trim(Request.QueryString("emne2")) = "updoc" then %>
<!--#include file="uploaddoc.asp" -->
<%end if%> </td>
</tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%">
<tr>
<td width="50%" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%" class="topbar" align="center">Forum</td>
</tr>
<tr>
<td width="100%"></td>
</tr>
<tr>
<td width="100%"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%"><br><MARQUEE onmouseover='this.stop();' onmouseout='this.start();' scrollamount='1' scrolldelay='75' top='0' left='0' width='100' height='70' direction="up"><!-- #include file="../salg.asp"--></marquee></td>
</tr>
<tr>
<td width="100%"><br><MARQUEE onmouseover='this.stop();' onmouseout='this.start();' scrollamount='1' scrolldelay='75' top='0' left='0' width='100' height='70' direction="up"><!-- #include file="../koeb.asp"--></marquee></td>
</tr>
</table>
</td>
<td width="50%" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%" valign="top"><!-- #include file="download.asp"--> </td>
</tr>
</table>
</td>
</tr>
</table>
</center>