Jump to content

saving cookie information in sessions


DLR

Recommended Posts

Hi all.
I want people to be free to browse my site for information - and only provide their name if they want to log in (there is no benefit to the viewer for this, other than having one's name on the pages).

I would like the index page to welcome them automatically (i.e without signing in) each time eg. "Hello [color=red]David [/color] (name from cookie), welcome back". So I need to set cookies.

However I want to encourage them to sign up for my newsletter. I want to make the site friendly and I want to have the signup page automatically insert the name from the cookie, into the form

<input type ="text" value=" <?php echo $_COOKIE('name'); ?> ">

I know this can be done - this forum does it when I open the page - but how?

This has got me beat!
Any guidance will be most welcome!
Thank you
Link to comment
https://forums.phpfreaks.com/topic/34302-saving-cookie-information-in-sessions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.