Ankündigung

Einklappen
Keine Ankündigung bisher.

PayPal $_POST Variablen

Einklappen

Neue Werbung 2019

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

  • #31
    Code:
    [...]httpd.www/database.php(4): PDO->__construct([...]
    Da liegt das Problem, nicht in dem von dir geposteten Teil.

    Kommentar


    • #32
      Zitat von ChromOxid Beitrag anzeigen
      Code:
      [...]httpd.www/database.php(4): PDO->__construct([...]
      Da liegt das Problem, nicht in dem von dir geposteten Teil.
      Was bedeutet das?

      Was muss ich machen?

      Kommentar


      • #33
        Zitat von king-ich Beitrag anzeigen
        Was bedeutet das?

        Was muss ich machen?
        Die richtigen Datenbankverbindungsdaten verwenden.

        Kommentar


        • #34
          Funktioniert. Danke

          Kommentar


          • #35
            Vieleicht kann noch einer hier einen Blick drüber werfen:

            Code:
            [16-Feb-2018 10:57:14 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'tag' cannot be null in /customers/5/5/f/tages-jobs.com/httpd.www/action.php:27
            Stack trace:
            #0 /customers/5/5/f/tages-jobs.com/httpd.www/action.php(27): PDOStatement->execute(Array)
            #1 {main}
              thrown in /customers/5/5/f/tages-jobs.com/httpd.www/action.php on line 27
            Wird als Fehlermeldung in der error.log geworfen.

            (Ist eine 2te Seite von mir.)


            Und das ist der Code:

            Code:
            $titel = $_POST["item_name"];
            $tag = $_POST["os0"];
            $monat = $_POST["os1"];
            $jahr = $_POST["os2"];
            $land = $_POST["os3"];
            $plz = $_POST["address_zip"];
            $ort = $_POST["address_city"];
            $dauer = $_POST["height_unit"];
            $lohn = $_POST["width_unit"];
            $beschreibung = $_POST["custom"];
            $kontakt_email = $_POST["payer_email"];
            $kontakt_tel = $_POST["contact_phone"];    
            $kdnr = $_SESSION['id'];
            $datum = date('y-m-d');
            
            
            $statement = $pdo->prepare("INSERT INTO angebote (id, titel, tag, monat, jahr, land, plz, arbeits_ort, dauer, lohn, beschreibung, kontakt_email, kontakt_tel, kdnr, datum) VALUES ('', :titel, :tag, :monat, :jahr, :land, :plz, :arbeits_ort, :dauer, :lohn, :beschreibung, :kontakt_email, :kontakt_tel, :kdnr, :datum)");
            
            $result = $statement->execute(array('titel' => $titel, 'tag' => $tag, 'monat' => $monat, 'jahr' => $jahr, 'land' => $land, 'plz' => $plz, 'arbeits_ort' => $ort, 'dauer' => $dauer, 'lohn' => $lohn, 'beschreibung' => $beschreibung, 'kontakt_email' => $kontakt_email, 'kontakt_tel' => $kontakt_tel, 'kdnr' => $kdnr, 'datum' => $datum));
            Obwohl das Feld nicht leer ist ($_POST['os0'])

            Kommentar


            • #36
              MySQL lügt nicht. $tag ist wohl null.

              Kommentar


              • #37
                Mal ganz davon abgesehen ist es totaler Quatsch Tag, Monat und Jahr einzeln zu speichern. Dafür gibs Datumstypen.

                Kommentar


                • #38
                  Zitat von ChromOxid Beitrag anzeigen
                  Mal ganz davon abgesehen ist es totaler Quatsch Tag, Monat und Jahr einzeln zu speichern. Dafür gibs Datumstypen.
                  Macht sich aber Optisch sehr schön:

                  z.b.: https://www.glueck-wunsch.com

                  Kommentar


                  • #39
                    Optik und Datenbank haben aber nichts miteinander zu tun. Ganz davon abgesehen ist ein Datepicker sicher etwas nutzerfreundlicher.

                    Kommentar


                    • #40
                      Geht die $_SESSION['id'] verloren wenn ich bei PayPal war?

                      PHP-Code:
                      <?php
                      session_start
                      ();
                      error_reporting(E_ALL);
                      ini_set ('display_errors'1); // 1 = show error messages in the browser, 0 = hide them
                      ini_set('log_errors',true);
                      ini_set('error_log','/customers/5/5/f/tages-jobs.com//httpd.www/PHP_errors.log');
                      include(
                      "database.php");



                      $titel $_POST["item_name"];
                      $tag $_POST["option_selection1"];
                      $monat $_POST["option_selection2"];
                      $jahr $_POST["option_selection3"];
                      $land $_POST["option_selection4"];
                      $plz $_POST["address_zip"];
                      $ort $_POST["address_city"];
                      $dauer $_POST["option_selection5"];
                      $lohn $_POST["option_selection6"];
                      $beschreibung $_POST["custom"];
                      $kontakt_email $_POST["payer_email"];
                      $kontakt_tel $_POST["option_selection7"];
                      $kdnr $_SESSION['id']; 
                      $datum date('y-m-d');


                      $statement $pdo->prepare("INSERT INTO angebote (id, titel, tag, monat, jahr, land, plz, arbeits_ort, dauer, lohn, beschreibung, kontakt_email, kontakt_tel, kdnr, datum) VALUES ('', :titel, :tag, :monat, :jahr, :land, :plz, :arbeits_ort, :dauer, :lohn, :beschreibung, :kontakt_email, :kontakt_tel, :kdnr, :datum)");

                      $result $statement->execute(array('titel' => $titel'tag' => $tag'monat' => $monat'jahr' => $jahr'land' => $land'plz' => $plz'arbeits_ort' => $ort'dauer' => $dauer'lohn' => $lohn'beschreibung' => $beschreibung'kontakt_email' => $kontakt_email'kontakt_tel' => $kontakt_tel'kdnr' => $kdnr'datum' => $datum));  

                      ?>
                      Ich bekomme nämlich die Fehlermeldung

                      [16-Feb-2018 13:42:54 UTC] PHP Notice: Undefined index: id in /customers/5/5/f/tages-jobs.com/httpd.www/action.php on line 21
                      [16-Feb-2018 13:42:54 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'kdnr' cannot be null in /customers/5/5/f/tages-jobs.com/httpd.www/action.php:29
                      Stack trace:
                      #0 /customers/5/5/f/tages-jobs.com/httpd.www/action.php(29): PDOStatement->execute(Array)
                      #1 {main}
                      thrown in /customers/5/5/f/tages-jobs.com/httpd.www/action.php on line 29

                      Kommentar


                      • #41
                        PayPal wird wohl keine Session bei dir haben.

                        Kommentar


                        • #42
                          PHP-Code:
                          $kdnr $_SESSION['id'];
                          setcookie("kdnr"$kdnr); 
                          vor der Weiterleitung an PayPal

                          &

                          Das empfangene Script:

                          PHP-Code:
                          <?php
                          session_start
                          ();
                          error_reporting(E_ALL);
                          ini_set ('display_errors'1); // 1 = show error messages in the browser, 0 = hide them
                          ini_set('log_errors',true);
                          ini_set('error_log','/customers/5/5/f/tages-jobs.com//httpd.www/PHP_errors.log');
                          include(
                          "database.php");



                          $titel $_POST["item_name"];
                          $tag $_POST["option_selection1"];
                          $monat $_POST["option_selection2"];
                          $jahr $_POST["option_selection3"];
                          $land $_POST["option_selection4"];
                          $plz $_POST["address_zip"];
                          $ort $_POST["address_city"];
                          $dauer $_POST["option_selection5"];
                          $lohn $_POST["option_selection6"];
                          $beschreibung $_POST["custom"];
                          $kontakt_email $_POST["payer_email"];
                          $kontakt_tel $_POST["option_selection7"];
                          $kdnr $_COOKIE["kdnr"]; 
                          $datum date('y-m-d');
                          $aktiv "true";

                          $statement $pdo->prepare("INSERT INTO angebote (id, titel, tag, monat, jahr, land, plz, arbeits_ort, dauer, lohn, beschreibung, kontakt_email, kontakt_tel, kdnr, datum, aktiv) VALUES ('', :titel, :tag, :monat, :jahr, :land, :plz, :arbeits_ort, :dauer, :lohn, :beschreibung, :kontakt_email, :kontakt_tel, :kdnr, :datum, :aktiv)");

                          $result $statement->execute(array('titel' => $titel'tag' => $tag'monat' => $monat'jahr' => $jahr'land' => $land'plz' => $plz'arbeits_ort' => $ort'dauer' => $dauer'lohn' => $lohn'beschreibung' => $beschreibung'kontakt_email' => $kontakt_email'kontakt_tel' => $kontakt_tel'kdnr' => $kdnr'datum' => $datum'aktiv' => $aktiv));  


                          ?>
                          Sollten mich eigentlich zum Ziel führen.

                          Aber:
                          Integrity constraint violation: 1048 Column 'kdnr' cannot be null

                          Kommentar


                          • #43
                            Wenn Paypal keine Session bei dir hat werden sie wohl auch kein Cookie bei dir haben, nicht?

                            Kommentar


                            • #44
                              Und nun?

                              Kommentar


                              • #45
                                Hab's jetzt so gemacht:

                                PHP-Code:
                                $kdnr $_POST["item_number"]; 
                                Die die sauberste Lösung, aber es funktioniert.

                                Kommentar

                                Lädt...
                                X