Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Won't Redirect

Status
Not open for further replies.

damipera

Technical User
Dec 1, 2005
134
GB
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>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top