SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict ibeblunt's Avatar
    Join Date
    Jan 2001
    Location
    Jersey City, NJ
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For some reason I am trying to read a cookie I save but the cookie variable is blank. Here is what I have:

    In this one page I wrote I do it like so:

    if (($username == $search_username) && ($password == $search_password)) {

    $cookie_name = "linkadmin";

    $cookie_value = "yes";

    $cookie_expire = "0";

    $cookie_domain = ".sohh.com";

    setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain, 0);

    echo "$linkadmin: Logged in properly!";

    exit;

    header("Location: index.php");

    exit;

    } else {

    echo "Logged in unproperly!";

    unset($action);

    }

    I see the message ": Logged in properly" but nothing else. It should say "yes: Logged in properly!"

    Then I took the same code and placed it by itself
    http://www.sohh.com/search/admin/test.php

    and that worked. Any ideas?

    Steven Samuel
    <///////~

    www.sohh.com

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $linkadmin isn't set until you reload the page and PHP parses the cookie.

  3. #3
    SitePoint Addict ibeblunt's Avatar
    Join Date
    Jan 2001
    Location
    Jersey City, NJ
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks
    Last edited by ibeblunt; May 16, 2001 at 21:01.
    <///////~

    www.sohh.com


Bookmarks

Posting Permissions

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