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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Greeting

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
[tt]Does anyone know where I can find the piece of code that would response.write "Welcome Back" in my home page if a visitor has already visited and I would like a small pop-up window I've created to show up if the visitor has open our home site for the first time.


"The reward of one duty done is the power to fulfill another"
Jr Cl[atom]wn


 
To do this, you will need to write a cookie to the users browser.

Then when the user returns you look for the cookie, and if you find it write the response.write "Welcome Back". If not, then you execute the code that will display the popup.

Something like.

If Request.cookies(&quot;mysite&quot;) <> &quot;&quot; then
response.write &quot;Welcome Back&quot;
else
response.cookie(&quot;mysite&quot;) = &quot;value for cookie&quot;
window.open ......
end if

The cookie is the only way to store something on the client machine to tell if they have been there or not. You could try doing a check of the IP which could be stored in a DB, but with DHCP most of the times those change, so you wouldn't really know. The money's gone, the brain is shot.....but the liquor we still got.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top