webForumDet fria alternativet

Fuc'ked up..

ASP

9 svar · 183 visningar · startad av RDL

Medlem sedan mars 2001344 inlägg
Frågan#1

Ursäkta rubriken.. men kom inte på någon bättre eftersom det är verkligen rätt fucked up..

Jaja.. hursomhelst..
<%
Dim Personer
Personer = "<a href=" & Application("adiosas") & ".asp>" & Application("adiosas") & "</a><br>"
Response.Write Personer
%>

Blir

<a href=*ono*doe.asp>*ono*doe</a>

hm.. ett vill ha bort dessa: *
Sen vill jag bara ha ett namn i adiosas i taget så att det blir
<a href=ono.asp>ono</a>
<a href=doe.asp>doe</a>

Någon som har lust att hjälpa??

Medlem sedan dec. 19998 577 inlägg
#2

Varför finns det så ifrån början om du inte vill ha det så :q

------------------
Vide rox = new Vide();
rox.learn("C#");

webeye.nu

Medlem sedan mars 2001344 inlägg
#3

Var finns vad?? *förvirrad*

Medlem sedan mars 2001344 inlägg
#4

hm.. vill inte ha så!! vill inte!! ändra!! ::) :) :)

Medlem sedan dec. 19998 577 inlägg
#5

Ja, varför har du värdet "*ono*doe" i Application("adiosas") om du inte vill ha det så?

------------------
Vide rox = new Vide();
rox.learn("C#");

webeye.nu

Medlem sedan mars 2001344 inlägg
#6

gah.. får grudeleiosera mig..

Har två sessioner den ena heter ono den andra doe.. Vill att de ska dela upp sig.. sen fattar jag inte att varför det blir * or framför??

Försökte med Replace.. fast lyckades inge vidare..

Medlem sedan dec. 19998 577 inlägg
#7

jo, det är ju bättre att inte skapa buggen i första hand än att försöka ta bort den i efterhand...

Hur ser koden ut som lägger in sessionerna i application?

------------------
Vide rox = new Vide();
rox.learn("C#");

webeye.nu

Medlem sedan mars 2001344 inlägg
#8

Lite variabler ändrade..

Global.asa
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart
Application("anv") = 0
End Sub

Sub Session_OnStart
Session.Timeout = 20
Session("Start") = Now

Application.Lock
	Application("anv") = Application("anv") + 1
Application.UnLock
Session.TimeOut = 20

End Sub

Sub Session_OnEnd
Application.Lock
Application("anv") = Application("anv") - 1
Application("users") = Replace(Application("users"), "*" & Session("anv") & "*", "*")
Application("writeUsr1") = Application("writeUsr2")
Application("writeUsr2") = Application("writeUsr3")
Application("writeUsr3") = Application("writeUsr4")
Application("writeUsr4") = Application("writeUsr5")
Application("writeUsr5") = Application("writeUsr6")
Application("writeUsr6") = ""
Application.UnLock

End Sub

</SCRIPT>

Flygin.asp

Session("inne") = 1
session("anv") = rsUser("username")

Application.Lock
	Application("users") = Application("users") & "\*" & Session("anv")
	Application("writeUsr1") = Application("writeUsr2")
	Application("writeUsr2") = Application("writeUsr3")
	Application("writeUsr3") = Application("writeUsr4")
	Application("writeUsr4") = Application("writeUsr5")
	Application("writeUsr5") = Application("writeUsr6")
	Application("writeUsr6") = ""
Application.UnLock

Test.asp
<%
Option Explicit
if Session("inne") = 1 then
%>
<!-- #include file="ssi/huvudet.asp" -->
<center>
<font class="s">
<b><u>Inloggade användare:</u></b><br>

<%
Dim Personer
Personer = "<a href=" & Application("users") & ".asp>" & Application("users") & "</a><br>"
Response.Write Personer
%>
<br>
<b><% =Application("anv") %></b> inloggade nu
</font>
</center>
</body>
</html>
<% end if %>

Hjälper det?

Medlem sedan dec. 19998 577 inlägg
#9

Något sånthär:

aA = Split(Application("adiosas"),"*")

For i = 0 To Ubound(aA)
Response.Write "<a href=" & aA(i) & ".asp>" & aA(i) & "</a><br>"
Next

------------------
Vide rox = new Vide();
rox.learn("C#");

webeye.nu

Medlem sedan mars 2001344 inlägg
#10

skyst vide!!

funkade perfa!!

262 ms totalt · 4 externa anrop · v20260731065814-full.a51de22e
122 ms — deklarationer (db)
0 ms — hämta statistik (cache)
132 ms — hämta tråd, inlägg och bilagor (db)
125 ms — ändringar (db)