README.md

December 4, 2022 ยท View on GitHub

Description

The first time the users comes to the page, it'll have a text box and a button. Once you type in your nick and hit Set Nick, it'll display Welcome [the nick they entered]. This is just an example on how-to set/read cookies.

More Info

The code asks you to enter a nick/name.

This example is to provide newusers info on how-to use cookies.

request.cookies("Var") - Get's a variable

response.cookies("Var") = "blah" - Set's a varible

"" is like the C command null

Once your nick/name is set, every time you goto the page, it'll Say Welcome [Nick]

None Known

Submitted On
ByMarkus D
LevelBeginner
User Rating5.0 (35 globes from 7 users)
CompatibilityASP (Active Server Pages)
CategoryMiscellaneous
WorldASP / VbScript
Archive File

API Declarations

This code was porduced by Fluid of Fluid Enterprises [http://fluid.hack3r.com]. If may be freely distributed but it would be nice if you contacted me and told that your using it.

Source Code

' Put this at the top of the page
<%
If (request("REQUEST_METHOD") = "POST") then
Dim Nick
nick = request("Nick")
response.cookies("Nick") = nick
end if
%>
'Put this where you want the Welcome Nick
<%
if request.cookies("Nick") <> "" then
response.write "Welcome "
response.write request.cookies("Nick")
end if
%>
'Put this where you want the text box to appear
<%
if request.cookies("Nick") = "" then
response.write "<BR><FORM NAME='message' METHOD='POST' ACTION='THIS_FILES_NAME.asp'><INPUT TYPE='text' NAME='Nick' Size='10' MAXLENGTH='25'>&nbsp;&nbsp;&nbsp;<INPUT TYPE='SUBMIT' VALUE='Set Nick'>"
end if
%>