Pjblog extension code: Use cookies to give back to the user greeting

Source: Internet
Author: User

Accidentally in a friend's blog to see a very interesting effect, when you reply in its blog, or message, cookies record the user name of your message, and your next visit, the title of its blog before the Add, welcome to a certain return words. At that time feel very intimate, user experience is good, here will be released to share with you.

Add the code before header.asp file


<%
If Request.Cookies (cookiename) ("Guest") <> "" Then
Dim a,b
A = Split (Request.Cookies (CookieName) ("Guest"), "-")
B=split (A (1), "$")
%>
<script type= "Text/javascript" >
Document.title = "Hi" + ' <% Response.Write (b (0))%> ' + "Welcome back," + Document.title
</script>
<% Else%>
<script type= "Text/javascript" >
Document.title = "If a new user comes in and you want to give a greeting to a new user, you can add a greeting here, or leave it blank to" + document.title
</script>
<% End If%>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.