I have a code that use a variable session to control what it must be shown of the page.
The first time that the page is to be loading, a form of data is appears. If the user click in the button submit of the form, the records are save in the database and appear the message "the data had been recorded". If the user refresh the page must be appear another message, for example, "Page expired".
The first time that the page is to be loading the variable session comes with de value 0.
When the user click in the button submit (onclick event) the variable session assumes the value 100.
The problem is:
- when the user refresh the page, the variable session assumes value 100 and the records are to be saved in the database, instead of appearing the message “Page expired”.
What can i do? Thanks.
The code of "page.asp":
...
<BODY>
...
<% If Session("conta")=0 Then %>
...
<form action="page.asp">
...
<input type="submit" value="SAVE"
onclick='<% Session("conta")=100 %>'>
</form>
<% ElseIf Session("conta")=100 Then %>
...
<p>The data had been recorded!</P>
<% Session("conta")=33 %>
<% Else %>
...
<p>Page expired!</P>
<% End If %>
...
</body>
Pergunta
Jorge Roman
I have a code that use a variable session to control what it must be shown of the page.
The first time that the page is to be loading, a form of data is appears. If the user click in the button submit of the form, the records are save in the database and appear the message "the data had been recorded". If the user refresh the page must be appear another message, for example, "Page expired".
The first time that the page is to be loading the variable session comes with de value 0.
When the user click in the button submit (onclick event) the variable session assumes the value 100.
The problem is:
- when the user refresh the page, the variable session assumes value 100 and the records are to be saved in the database, instead of appearing the message “Page expired”.
What can i do? Thanks.
The code of "page.asp":
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.