cookie problem

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • cookie problem

    ich hab das problem das das ganze local geht aber sobald ich es hochschiebe gehts nimma...


    PHP-Code:
    <?
    if (! isset ( $HTTP_COOKIE_VARS["membersindex"] ) ) {
    setcookie ("kelly-osbourne.de", "keks", time()+3600*24); }
    if (! isset ( $HTTP_COOKIE_VARS["membersindex"] ) ) {
    echo "popupcode";
    echo $HTTP_COOKIE_VARS["membersindex"]; }
    ?>

    dazu muss ich aber sagen das ich es lokal direkt aufrufe und online dann über eine subdomain ...




    Danke


    Joat
    the end comes faster than you think - you've already reached it!

  • #2
    Du setzt doch 'membersindex' nirgends?
    Eigentlich sollte das nirgends (auch nicht lokal) laufen.

    Wenn ich Dich richtig verstanden habe, sollte das so aussehen:
    PHP-Code:
    if (! isset ( $HTTP_COOKIE_VARS["membersindex"] ) ) {
        
    setcookie ("membersindex""keks"time()+86400);

    setcookie ( string name [, string value [, int expire [, string path [, string domain [, int secure]]]]])

    http://de2.php.net/manual/de/function.setcookie.php

    P.S.: Wieso eigentlich 2x
    PHP-Code:
    if (! isset ( $HTTP_COOKIE_VARS["membersindex"] ) ) 
    ???

    Dein echo macht da keinen Sinn, da '$HTTP_COOKIE_VARS["membersindex"]' immer leer sein sollte.
    Putz den Code nochmal

    P.P.S.: Und das funktioniert lokal?
    Zuletzt geändert von Konrad; 30.07.2003, 16:43.
    Konrad

    In a world without walls and fences, who needs Windows and Gates ?
    (Sun Microsystems)

    Kommentar


    • #3
      uppsss..... ich hatte ne alte datei erwischt.....

      richtig:


      PHP-Code:
      <?
      if (! isset ( $HTTP_COOKIE["membersindex"] ) ) {
      setcookie ("membersindex", "keks", time()+10);
      echo "mache popup"; }
      if ( isset ( $HTTP_COOKIE["membersindex"] ) ) {
      echo "mache kein popup"; }
      ?>

      das ganze soll so sein das wenn kein keks da ist dann soll einer gesetz werden und ein popup wenn das cookie da ist dann soll kein popup gemacht werden


      lokal gehts wunderbar....

      nur online nicht



      JOat
      the end comes faster than you think - you've already reached it!

      Kommentar


      • #4
        Unterschiedliche PHP-Versionen/Konfigurationen?
        Was sagt den phpinfo(); ?

        Vom Client gesendete Cookies werden - abhängig von den Konfigurationsvariablen register_globals und variables_order - automatisch in eine Variable geschrieben, wie es auch bei mittels GET oder POST gesendeten Daten geschieht. Sollen einem Cookie mehrere Werte zugewiesen werden, so muss dem Cookienamen lediglich [] angefügt werden.

        Seit PHP 4.1.0 werden alle vom Client gesendeten Cookies in dem auto-globalen Array $_COOKIE gespeichert. In älteren PHP-Versionen stehen diese Daten in $HTTP_COOKIE_VARS gespeichert, sofern die Konfigurationsvariable track_vars gesetzt ist.
        Konrad

        In a world without walls and fences, who needs Windows and Gates ?
        (Sun Microsystems)

        Kommentar


        • #5
          da ich nicht genau weiß was du wissen willst:

          http://testing.membersindex.info/info.php
          the end comes faster than you think - you've already reached it!

          Kommentar


          • #6
            ok, nimm mal '$_COOKIE' als Superglobal

            Und wenn das net funzt, stell mal Deinen Browser bei Cookies auf 'Eingabeaufforderung' und lass Dir mal unter 'Details' anzeigen, was da gesendet wird (wenn überhaupt).

            Oder haste in Deinem 2. Script nur das '_vars' vergessen, also statt

            $HTTP_COOKIE
            $HTTP_COOKIE_VARS
            Konrad

            In a world without walls and fences, who needs Windows and Gates ?
            (Sun Microsystems)

            Kommentar


            • #7
              meinst du

              global $_COOKIE; ???


              wenn ich mit eingabeaufforderung mach bekomm ich nix...
              Zuletzt geändert von JOat; 30.07.2003, 18:11.
              the end comes faster than you think - you've already reached it!

              Kommentar


              • #8
                hmm...
                time()+10
                geht die Uhr von Deinem Server nach?
                Mach mal erst mal ohne time() und schau mal, ob nen Cookie für die Session funzt.
                Konrad

                In a world without walls and fences, who needs Windows and Gates ?
                (Sun Microsystems)

                Kommentar


                • #9
                  hmmm......


                  wenn ich keine zeit angeben da funktioniert das ganze aber sobald ich dann wieder ne zeit angebe auch wenn mit 3600 ist gehts nicht...
                  the end comes faster than you think - you've already reached it!

                  Kommentar


                  • #10
                    Was sacht Dein Server?
                    Wie spät isses bei dem (inkl. Datum)
                    Konrad

                    In a world without walls and fences, who needs Windows and Gates ?
                    (Sun Microsystems)

                    Kommentar


                    • #11
                      nja .... die zeit stimmt nicht so ganz .... ~5min


                      http://testing.membersindex.info/info.php#ttt
                      the end comes faster than you think - you've already reached it!

                      Kommentar


                      • #12
                        zeit ist ziemlich genau würde ich sagen. nix 5 min.

                        Kommentar


                        • #13
                          oh..... ich hab mal die systime mit nem timserver syncronisiert .... -> meine systime war falsch....
                          the end comes faster than you think - you've already reached it!

                          Kommentar


                          • #14
                            und nun ist alles ok?
                            Konrad

                            In a world without walls and fences, who needs Windows and Gates ?
                            (Sun Microsystems)

                            Kommentar


                            • #15
                              nö...


                              geht einfach nicht....
                              the end comes faster than you think - you've already reached it!

                              Kommentar

                              Lädt...
                              X