Session Variable

Hi: I delete the files/cookies and clear history from the IE 6.0
browser and try to write in a text file use FSO but it dont write any
thing in the file needs help

Thanks.

vote_input.asp
<form method="post" action="vote.asp">

<p><input type="radio" value="A" name="u_input">A<br>
<input type="radio" value="B" name="u_input" >B<br>
<input type="radio" value="C" name="u_input">C<br>
<input type="radio" value="D" name="u_input">D<br>
<input type="submit" value="Submit" ></p>
</form>

vote.asp
<%
on error resume next
u_input=request.form("u_input") %>

<% set fso = createobject("scripting.filesystemobject")
if session("voted_before") = "" then
session("voted_before") = "Yes"
' reads and adds a one to the selected value
g_selected="vote_count"& u_input &".txt"
set act = fso.opentextfile(server.mappath(g_selected))
counter = clng(act.readline)
counter = counter + 1
act.close
Set act = fso.CreateTextFile(server.mappath(g_selected), true)
act.WriteLine(counter)
act.Close
end if
%>



<%
g_selected="vote_counta.txt"
set act = fso.opentextfile(server.mappath(g_selected))
counter_a = clng(act.readline)

%>



<%
g_selected="vote_countb.txt"
set act = fso.opentextfile(server.mappath(g_selected))
counter_b = clng(act.readline)

%>



<%
g_selected="vote_countc.txt"
set act = fso.opentextfile(server.mappath(g_selected))
counter_c = clng(act.readline)

%>


<%
g_selected="vote_countd.txt"
set act = fso.opentextfile(server.mappath(g_selected))
counter_d = clng(act.readline)

%>


<% total=counter_a+counter_b+counter_c+counter_d
%><br>


<br>
A <img src="images/red.jpg" height="12" width="<%= (counter_a/
total)*100 %>"><%= formatnumber((counter_a/total)*100,1) %>%<br>
B <img src="images/red.jpg" height="12" width="<%= (counter_b/
total)*100 %>"><%= formatnumber((counter_b/total)*100,1) %>%<br>
C <img src="images/red.jpg" height="12" width="<%= (counter_c/
total)*100 %>"><%= formatnumber((counter_c/total)*100,1) %>%<br>
D <img src="images/red.jpg" height="12" width="<%= (counter_d/
total)*100 %>"><%= formatnumber((counter_d/total)*100,1) %>%<br>
Total Votes: <%= total %>
colleen1980 [ So, 19 August 2007 19:45 ] [ ID #1799048 ]

Re: Session Variable

<colleen1980 [at] gmail.com> wrote in message
news:1187545550.047533.48700 [at] r29g2000hsg.googlegroups.com...
> Hi: I delete the files/cookies and clear history from the IE 6.0
> browser and try to write in a text file use FSO but it dont write any
> thing in the file needs help

Clearing cookies & cached files doesn't abandon the session.

You'll need to open a fresh instance of IE to create a new session.

--
Bob Milutinovic
Cognicom - "Australia's Web Presence Specialists"
http://www.cognicom.net.au/
telephone (0417) 45-77-66
facsimile (02) 9824-2240
Bob Milutinovic [ Mo, 20 August 2007 16:07 ] [ ID #1800043 ]
Webserver » microsoft.public.inetserver.asp.general » Session Variable

Vorheriges Thema: ASP Classic: Problems when trying to connect to a database.
Nächstes Thema: retrive xml value from localfile