SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    My current code:

    if ($ratings) { if (isset($rate_id)) { $cookie = 1; } else { setcookie ("rate_id", $id, time()+(3600*24), "", "nortiq.com", 0); /* Expires in a day */ } }


    Isn't working for netscpa.e
    Howveer, its perfectly fine with Internet Explorer.

    Any errors?

    Thanks Guys
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  2. #2
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    setcookie ("rate_id", $id, time()+(3600*24), "/", "nortiq.com", 0);

    that should work... netscape is more touchy about things are
    cogito, ergo sum

  3. #3
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh...cool
    Thanks for your help.

    So you cna't use empty quotes eh?
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  4. #4
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm..I tested it again
    It still doens't work
    netscpae 4 and netscaape 6/mozilla builds
    all don't work

    any solutions?
    thanks
    Last edited by lynlimz; Feb 11, 2001 at 20:54.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  5. #5
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also am having the same problem... works great in IE but not in NS 4.7+

    Any Ideas? I'm using this code....

    Code:
    setcookie ("my_username", $username, time()+(3600*3), "/", "beartoothbullets.com", 0);
    It's just not setting the cookie...
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services

  6. #6
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sigh..
    This really sucks eh..
    I thought this was a server side code which would be understood by all the browsers..

    guess the setcookie isn't.

    BTW..how do you check whether a cookie is set in netscpae 4 and mozilla builds?

    i just test out my script..if it reocrds the vote more thna once, then a cookie isn't set...hmm..
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  7. #7
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been playing with it all evening... and yes it does suck

    I have to use them for a database of loading data... the user excepts the agreement, then he can view the stuff... or if he is registered, he can enter his username/password to keep from having to enter them all throughout the site... I have been using cookies... planning this huge site to use cookies... and now it goofs up on me...

    I'll keep playing with it.. see if I can get NS to take it... if I do I'll let you know..

    God Bless
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services

  8. #8
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got it!

    here is the correct code for you..

    Code:
    setcookie ("rate_id", $id, time()+(3600*24), "/", ".nortiq.com", 0);
    this will work in NS if you notice all I added was the "." in front of the domain...

    please note, this only works if the url has the www in front of it in NS so..

    if user goes to http://nortiq.com, the cookie will not work... however,

    http://www.nortiq.com will.

    So, you may be able to use a header(location: ) to redirect them to www.nortiq.com

    note... IE will work with this code with or without the www... so IE is not affected I don't think

    hope this helps!
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services

  9. #9
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,

    can i set multiple rate_id with different values?

    like 1 rate_id for every article?

    thanks

    hmm..okie..i'll give it a try..thanks exbablylon
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  10. #10
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think that you will have to do something like this:

    Article one

    Code:
    setcookie ("rate_one", $id, time()+ 3600*24), "/", ".nortiq.com", 0);
    Article two
    Code:
    setcookie ("rate_two", $id, time()+ 3600*24), "/", ".nortiq.com", 0);
    etc.

    Otherwise you will overwrite the cookie rate_id each time you set it...

    God Bless, hope that the cookie thing works out.
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services

  11. #11
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh..cici..okie
    thanks for your help!
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  12. #12
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i was just going to say the "." thing, but i guess i was a little late in checking this post

    but nice to see that you have got it working
    cogito, ergo sum

  13. #13
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep
    Thnaks Vinay

    I managed to get the cookie to work. =)
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


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
  •