[HTML/PHP] Gedankenanstoß - Formular verarbeitung

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

  • #16
    Original geschrieben von raffiausgoslar


    PHP-Code:
                  $query "SELECT * FROM truppenmanager WHERE T17 LIKE '$T17' LIMIT 1;";
                
                if(
    $query == true)
                    {
                   
              
    //Aktualisierung der Datenbank
                    
    $errorcode NULL;
                            
                            
    $sql "UPDATE 
                            truppenmanager 
                                            SET
                              T1 = '
    $T1',
                              T2 = '
    $T2',
                              T3 = '
    $T3',
                              T4 = '
    $T4',
                              T5 = '
    $T5',
                              T6 = '
    $T6',
                              T7 = '
    $T7',
                              T8 = '
    $T8',
                              T9 = '
    $T9',
                              T10 = '
    $T10',
                              T11 = '
    $T11',
                              T12 = '
    $T12',
                              T13 = '
    $T13',
                              T14 = '
    $T14',
                              T15 = '
    $T15',
                              T16 = '
    $T16'
                                            WHERE T17 = '
    $T17' LIMIT 1;";
                           
                            
    $result mysql_query($sql) OR FALSE;                    
                            if(
    $result == FALSE)
                  {
                  
            
    $errorcode mysql_errno();
                        if(
    $errorcode 1146)
                        {
                              include 
    "firststart.php";
                        }else die(
    mysql_error()."<br> code: ".mysql_errno());

                    }
                    }
                    
                    else
                    
                    {
                           
    //Eintragung in die Datenbank

                        
    $sql "INSERT INTO
                              truppenmanager
                          SET
                              T17 = '"
    .addslashes(htmlspecialchars($T17))."' ,
                              T1 = '"
    .addslashes(htmlspecialchars($T1))."' ,
                              T2 = '"
    .addslashes(htmlspecialchars($T2))."' ,
                              T3 = '"
    .addslashes(htmlspecialchars($T3))."' ,
                              T4 = '"
    .addslashes(htmlspecialchars($T4))."' ,
                              T5 = '"
    .addslashes(htmlspecialchars($T5))."' ,
                              T6 = '"
    .addslashes(htmlspecialchars($T6))."' ,
                              T7 = '"
    .addslashes(htmlspecialchars($T7))."' ,
                              T8 = '"
    .addslashes(htmlspecialchars($T8))."' ,
                              T9 = '"
    .addslashes(htmlspecialchars($T9))."' ,
                              T10 = '"
    .addslashes(htmlspecialchars($T10))."' ,
                              T11 = '"
    .addslashes(htmlspecialchars($T11))."' ,
                              T12 = '"
    .addslashes(htmlspecialchars($T12))."' ,
                              T13 = '"
    .addslashes(htmlspecialchars($T13))."' ,
                              T14 = '"
    .addslashes(htmlspecialchars($T14))."' ,
                              T15 = '"
    .addslashes(htmlspecialchars($T15))."' ,
                              T16 = '"
    .addslashes(htmlspecialchars($T16))."' ,
                              ip = '"
    .$_SERVER['REMOTE_ADDR']."' ,
                              datum = NOW()  ;"
    ;
                  
    $result mysql_query($sql) OR FALSE;
                  if(
    $result == FALSE)
                  {
                        
    $errorcode mysql_errno();
                        if(
    $errorcode 1146)
                        {
                              include 
    "firststart.php";
                        }else die(
    mysql_error()."<br> code: ".mysql_errno());
                    }             
                    }
      

                            
              }while(
    $result != TRUE);
              echo 
    "<h2>Vielen Dank für Deinen Eintrag!</h2><br>";             
        }else echo 
    "<h2>Fehlerhafte Angaben - Bitte füllen Sie das Forumlar korrekt aus!<br> 
    das ist der relevante Teil...

    Kommentar

    Lädt...
    X