Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 9 of 9

Thread: Cookies

  1. #1
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default Cookies

    Hello im using a cookies script But i need a simple code that goes up the top of the page how to Like <script> AddCookie ('cookie.filename') </script> i have no clue if its possible or if you need MYSQL any help with this one pls
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

  2. #2
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    So you want to give a user a cookie yeh?

  3. #3
    Join Date
    Mar 2007
    Posts
    1,691
    Tokens
    1,025

    Latest Awards:

    Default

    Quote Originally Posted by chrisgocrazyH View Post
    Hello im using a cookies script But i need a simple code that goes up the top of the page how to Like <script> AddCookie ('cookie.filename') </script> i have no clue if its possible or if you need MYSQL any help with this one pls
    Google for christ's sake...

  4. #4
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Use sessions, they're safer. One little 'problem' is that when you close the browser they're destroyed.

    But this is how you use them...

    PHP Code:
    session_start(); // allowing you to start sessions

    $_SESSIONS['whatever'] = "Whatever is in the session, a username or whatever"// makes the session

    session_destroy(); // destroys the session 
    I don't know about cookies, much, as I never use them.

  5. #5
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Hitman View Post
    Use sessions, they're safer. One little 'problem' is that when you close the browser they're destroyed.

    But this is how you use them...

    PHP Code:
    session_start(); // allowing you to start sessions

    $_SESSIONS['whatever'] = "Whatever is in the session, a username or whatever"// makes the session

    session_destroy(); // destroys the session 
    I don't know about cookies, much, as I never use them.
    Same ^

    But he could want a spam cookie + not a user login cookie?

  6. #6
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    To set a cookie using Javascript use a function like this:

    HTML Code:
    <script type="javascript">
    <!--
    
    function SetCookie(cookieName,cookieValue,nDays) {
     var today = new Date();
     var expire = new Date();
     if (nDays==null || nDays==0) nDays=1;
     expire.setTime(today.getTime() + 3600000*24*nDays);
     document.cookie = cookieName+"="+escape(cookieValue)
                     + ";expires="+expire.toGMTString();
    }
    
    //-->
    </script>
    But seriously, ******* Google it next time :\

  7. #7
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    or in php..

    PHP Code:
    <?php
    ob_start
    ();
    setcookie("Cookie Name","Cookie Value",time()+3600);
    ?>
    Coming and going...
    Highers are getting the better of me

  8. #8
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default

    Quote Originally Posted by MrCraig View Post
    or in php..

    PHP Code:
    <?php
    ob_start
    ();
    setcookie("Cookie Name","Cookie Value",time()+3600);
    ?>

    And that means with the habbo Room maker im working on it will save it so every one can see how i have dragged it and put it in the room ""every one will be able to see that"" not just a fresh new room with no furni?
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

  9. #9
    Join Date
    Jan 2008
    Posts
    287
    Tokens
    0

    Default

    You seriously need to learn how to spell and speak before posting again, it is driving me crazy.

    Edited by Agesilaus (Forum Super Moderator): Please do not post off topic.
    Last edited by Agesilaus; 23-01-2008 at 11:29 AM.

Posting Permissions

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