need a cookie script in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nima
    Confirmed User
    • Feb 2003
    • 2192

    #1

    need a cookie script in php

    Hi
    I need a cookie script done in php on hwich I can set it to expire at any given time.

    Let me know if you can do this or know a website that has the code

    ICQ 63125103

    thanks
  • MrPopup
    Confirmed User
    • Aug 2002
    • 3783

    #2
    http://www.devshed.com/Server_Side/P...ics/page4.html
    <table cellspacing="0" cellpadding="3" border="1" bgcolor="#008000"><tr><td><font size=3>Gone</font></td></tr></table>

    Comment

    • Tipsy
      Confirmed User
      • Jul 2001
      • 6989

      #3
      I have a good cookie recipe if that helps?
      Ignorance is never bliss.

      Comment

      • Nezster
        Confirmed User
        • Feb 2003
        • 2192

        #4
        thanks for that link but i need one wihtout the use of mysql

        Comment

        • Nezster
          Confirmed User
          • Feb 2003
          • 2192

          #5
          Originally posted by Tipsy
          I have a good cookie recipe if that helps?
          no sorry that won't cut it

          Comment

          • Tipsy
            Confirmed User
            • Jul 2001
            • 6989

            #6
            Originally posted by Nezster
            thanks for that link but i need one wihtout the use of mysql
            You've not been too specific. Setting and retrieving a cookie is pretty simple. It depends more on what you want to do with it.
            Ignorance is never bliss.

            Comment

            • Nezster
              Confirmed User
              • Feb 2003
              • 2192

              #7
              Basically I am iframing an active-x dialer code on one of my CJs and I want it to only show once every 24 hours to the same person.

              Comment

              • vending_machine
                Confirmed User
                • Jun 2002
                • 1070

                #8
                Originally posted by Nezster
                Basically I am iframing an active-x dialer code on one of my CJs and I want it to only show once every 24 hours to the same person.
                Setting a cookie that lasts 24 hours:
                Code:
                &lt;?PHP
                setcookie(
                'COOKIE_NAME',
                'COOKIE_CONTENT',
                time( ) + 86400,
                '/',
                $_SERVER[ 'SERVER_NAME' ] );
                ?&gt;

                To check for the cookie:
                Code:
                &lt;?PHP
                if ( $_COOKIE[ 'COOKIE_NAME' ] )
                {
                // then blah
                }
                ?&gt;

                Comment

                • foe
                  Confirmed User
                  • May 2002
                  • 5246

                  #9
                  contact me ;)

                  Comment

                  • foe
                    Confirmed User
                    • May 2002
                    • 5246

                    #10
                    or just goto php.net and search for setcookie in the function list.

                    Comment

                    Working...