Hi guys, I have this code below that supposed to evaluate if the values of the textfield and the session token are equal. If they are equal they will be redirected to google. The thing is, they are both equal always but it doesn't redirect to google. I don't know what I am doing wrong. Please can you help?
Code:
<%@LANGUAGE="VBSCRIPT"%>
<HTML>
<%
FUNCTION GetGUID()
GetGUID = CStr(Mid(CreateObject("Scriptlet.TypeLib").GUID, 2, 36))
END FUNCTION
Dim token
token = GetGUID()
Session("token")=token
Public Function GetFormInputElement()
GetFormInputElement = "<input name=""token"" size=""50"" type=""text"" " & " value=""" & Session("token") & """ />"
End Function
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("token") = Session("token") Then
Response.redirect("[URL unfurl="true"]https://google.com")[/URL]
End If
End If
response.write(Session("token")) & "<br>"
response.write(Request.Form("token") = Session("token"))
%>
<BODY>
<form method="POST" action="cookie5c.asp">
<% =GetFormInputElement() %>
<input type="submit" name="Submit" value="Submit" />
</form>
</BODY>
</HTML>