Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: cookie

  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cookie

    Hii i wanna to do kind of text like this: welcome,(cookie)
    And i tried many things like $COOKIE and ($COOKIE) and ($_COOKIE) and this is dosent work.
    help?

  • #2
    New Coder
    Join Date
    Sep 2011
    Posts
    74
    Thanks
    0
    Thanked 7 Times in 7 Posts
    You need to set a cookie first using setcookie().

    Im assuming that the cookie would be the username of the current user so you could access it using $_COOKIE['username'].

    So when your user is successfully logged in thats when the cookie has to be set.

    Hope this helps.

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by davidjones1990 View Post
    You need to set a cookie first using setcookie().

    Im assuming that the cookie would be the username of the current user so you could access it using $_COOKIE['username'].

    So when your user is successfully logged in thats when the cookie has to be set.

    Hope this helps.
    it is not helpd
    P.S:I have another page named myprofile.php and there is wroten the username but i tried it too and i dosent work
    and the files from tutorial.

  • #4
    New Coder
    Join Date
    May 2012
    Posts
    50
    Thanks
    6
    Thanked 4 Times in 4 Posts
    I think you should read more about basic php and cookies. Then if you still don't know how to do it, ask.

  • #5
    New Coder
    Join Date
    Sep 2011
    Posts
    74
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by bjarneo View Post
    I think you should read more about basic php and cookies. Then if you still don't know how to do it, ask.
    I agree, have a look at the php manual. That explains it well with some nice examples. If it is still causing you problems, come back and post some code as well


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •