Ingen som har ork att kolla den här? :(
Hejsan!
Jag jobbar som sagt på ett meddelande script som gör att medlemmarna kan skicka meddelande till varandra and so on...
Nu vill jag alltså som administratör kunna skicka meddelanden till ALLA användare...
Jag har tyvärr inte en aning om hur jag ska lyckas med detta :)
Så här ser iaf koden ut i nuläget:
<!-- #include file="adovbs.inc" -->
<!-- #include file="../../data.inc" -->
<%
dim struserTO, struserFROM, strTopic, strText, strDatum, strIP
struserTO = Request.Form("userTO")
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "Driver={MySQL ODBC 3.51 Driver};server="&strserver&";uid="&struser&";pwd="&strpass&";database="&strdb&""
Set RecSet = Server.CreateObject("ADODB.Recordset")
MySQL = "SELECT * FROM members where username = '"& struserTO &"'"
Set RecSet = Connect.Execute(MySQL)
If NOT RecSet.EOF then
struserFROM = Request.Form("userFROM")
strtopic = Request.Form("topic")
strtext = Request.Form("text")
strdatum = Hour(Time) & ":" & Minute(Time) & ":" & Second(Time)
strIP = Request.ServerVariables("REMOTE_ADDR")
sql = " insert into message(userTO, userFROM, Topic, Text, Datum, IP) " & " values('" & struserTO & "','" & struserFROM & "', '" & strtopic & "','" & strtext & "','" & strdatum & "','" & strIP & "') "
Connect.Execute sql,,128
dim struserTO2, struserFROM2, strTopic2, strText2, strDatum2, strIP2
struserTO2 = Request.Form("userTO")
struserFROM2 = Request.Form("userFROM")
strtopic2 = Request.Form("topic")
strtext2 = Request.Form("text")
strdatum2 = Hour(Time) & ":" & Minute(Time) & ":" & Second(Time)
strIP2 = Request.ServerVariables("REMOTE_ADDR")
sql = " insert into message_outbox(userTO, userFROM, Topic, Text, Datum, IP) " & " values('" & struserTO2 & "','" & struserFROM2 & "', '" & strtopic2 & "','" & strtext2 & "','" & strdatum2 & "','" & strIP2 & "') "
Connect.Execute sql,,128
Session("fel") = "Meddelandet är nu skickat till " & Request.Form("userTO") & ". "
Response.Redirect("../message_send.asp")
else
Session("fel") = "Det finns ingen med det användarnamnet"
Response.Redirect "../message_send.asp"
end if
%>
Tacksam för svar! ;)
MVH Jonas "Mellow" Stenberg

