Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member Stylise's Avatar
    Join Date
    Jul 2005
    Location
    Mount Martha, Australia
    Posts
    229
    Member #
    10679
    Hey guys,

    I can't seem to get this to work, I must be doing something wrong, somewhere. I want to store an array into a cookie, here's what I've got.

    PHP Code:
    function setProjectCookies($new_projects)
    {
        
    //$cookie_projects = serialize($new_projects);

        
    setcookie(new_projectsserialize($new_projects), 0"/");
    }

    function 
    getNumNewProjects()
    {
        if (isset(
    $_COOKIE['new_projects']))
            
    $temp unserialize($_COOKIE['new_projects']);
        else
            return 
    0;

        if (
    sizeOf($temp) == 0)
            return 
    0;
        else
            return 
    sizeOf($temp);

    When I send an array to setProjectCookies() it seems to store it fine. When I go to grab getNumNewProjects() unserialize fails, and $temp becomes bool(false);

    Thanks.

  2.  

  3. #2
    Senior Member Stylise's Avatar
    Join Date
    Jul 2005
    Location
    Mount Martha, Australia
    Posts
    229
    Member #
    10679
    Nevermind, got it working, needed to get rid of the slashes


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:57 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com