Dynamic welcome messages

  • lomilmand
  • Student
  • Student
  • lomilmand
  • Posts: 91
  • Loc: Bournemouth, UK

Post 3+ Months Ago

I would like to add a (simple i'm sure) feature that provides the welcome line... "Hello [username]" or something like that. Where the [username] is obviously replaced with their name, which they provided the first time they entered the page (where there would have been a message saying "This is your first time to this page, please enter your name..." in a seperate new window.

I would guess that a cookie would have to be stored in their PC, but I don't know how to do this, or if there is a script about that I can place into my webpage.

Hope you can help me out. :?: Thanks.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • panreach
  • Novice
  • Novice
  • User avatar
  • Posts: 28

Post 3+ Months Ago

If you're able to add PHP or ASP to your pages use a session variable.
  • sazn
  • Student
  • Student
  • User avatar
  • Posts: 98

Post 3+ Months Ago

what you want to do can be done with javascript. i found a pre written script here - http://www.codelifter.com/main/javascri ... name1.html
:D
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

well a session is not really any good, as you want it to come back next visit. I would go for a cookie, created server-side. I would not use javascript as it will bloat the filesizes and generally just be a pain in the ass because people can turn of JS.

However
Quote:
which they provided the first time they entered the page (where there would have been a message saying "This is your first time to this page, please enter your name..." in a seperate new window.
forgive me if I'm wrong, but it seems to me that you are asking people to enter their name <b>just</b> so that they can see their name next time they visit. I know some people are dumb, but most of us don't need you to remind us of our own names :shock:

Shops like amazon do it because if someone has an account then it is just a little <b>add-on</b> to an <b>existing feature</b>, which makes sense, but doing it just for the sake of a message is a waste of time (both yours and the visitors). I would not enter my name just because a website told me to, because it was my first visit.

What I'm saying is, if you need accounts for genuine reasons, then all you need to do is save the userid as a cookie and recall it for each page view. But if you are just doing it for the sake of a welcome message, then you are probably wasting your time, it serves no purpose and will probably annoy more people than it will entice.

To find out how to do cookies, type "set cookie" asp/php (take your pick) into google. They are really simple and you should be able to find a thousand tutorials on how cookies work and how to set/retrieve them.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 39 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.