Hej visa bilder
jag ska kunna lägga in bildlänkar via admin script som jag har och visa bilden sedan
Det är något lurt för det funkar inte. Jag har ett fält i databasen för hyperlänkar som heter USER_PIC men hur skriver man länken så att bilden visas och hur skriver man koden. bifogar det jag gjort någon som ser felet.
Detta är admin scriptet/
<%
'this code writes all the modifications to the database
action=request.queryString("action")
'we need to know what message should we deal with
msgId = request.queryString("msgId")
if action="submit" or action="delete" then
'gets the data from the form
USER_MESSAGE = request.Form("USER_MESSAGE")
USER_NAME = request.Form("USER_NAME")
USER_PIC = request.Form("USER_PIC")
'converts the data to HTML format using the EncodeDara function
'since DB fields can't be zero-length, in case they're empty, we'll set them to " "
USER_MESSAGE = EncodeData(USER_MESSAGE)
USER_NAME = EncodeData(USER_NAME)
USER_PIC = EncodedData(USER_PIC)
'opens the database and writes data to it
select case action
case "delete"
SQLCOMMAND = "DELETE GBOOK.* FROM GBOOK WHERE (id = "& msgId &");"
DC.EXECUTE(SQLCOMMAND)
case "submit"
MYSQL = "SELECT GBOOK.* FROM GBOOK WHERE (id = " & msgId & ")"
rs.Open MYSQL, dc, 1, 3
rs.Fields("USER_NAME") = USER_NAME
rs.Fields("USER_MAIL") = USER_MAIL
rs.Fields("USER_CITY") = USER_CITY
rs.Fields("USER_URL") = USER_URL
rs.Fields("USER_MESSAGE") = USER_MESSAGE
rs.Fields("USER_PIC") = USER_PIC
rs.Update
end select
response.redirect ("admin.asp")
End If
%>
<%
action=request.queryString("action")
if action="modify" then
msgId = request.queryString ("msgId")
MYSQL = "SELECT GBOOK.* FROM GBOOK WHERE (id = "& msgId &")"
rs.Open MySQL, dc, 3, 1
%>
<form action="admin.asp?action=submit&msgId=<%=msgId%>" method="post">
<table align=center border=0 cellspacing=0 cellpadding=0 width="317">
</tr>
<tr> <td valign=top width="52"><strong><b>Rubrik:</b></td><td align=right width="265"><textarea cols=30 rows=4 name=USER_NAME wrap=virtual><%=rs("USER_NAME")%></textarea></td> </tr>
</strong><br>
<tr> <td valign=top width="52"><b>Nuvarande text:</b></td>
<td align=right width="265"><textarea cols=30 rows=4 name=USER_MESSAGE wrap=virtual><%=rs("USER_MESSAGE")%></textarea></td>
</tr>
<tr> <td valign=top width="52"><b>Bild:</b></td>
<td align=right width="265"><textarea cols=30 rows=4 name=USER_PIC wrap=virtual><%=rs("USER_PIC")%></textarea></td>
</tr>
<tr> <td width="52"> </td>
<td height=50 valign=bottom align=right width="265"><input type=submit value="ändra" onclick="return confirm('Nu är Ditt meddelande ändrat');"></td> </tr>
</table>
</form>
</br>
<%
rs.Close
end if
%>