irgendwie will meine Bildendung noch nicht so wirklich in die Datenbank...
Code: (original: rules.php, Anpassungen von mir: Bilderupload)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | <?php # Copyright by: Kerim Yagmurcu # Support: www.ilch.de defined ( 'main' ) or die ( 'no direct access' ); defined ( 'admin' ) or die ( 'only admin access' ); $design = new design ( 'Admins Area' , 'Admins Area' , 2 ); $design ->header(); include ( 'include/includes/func/gallery.php' ); $path = "include/images/kfzwerkstatt" ; if (! is_dir ( $path . $name )){ mkdir ( $path . $name ,0777); } $um = '' ; if (isset( $_REQUEST [ 'um' ])) { $um = $_REQUEST [ 'um' ]; } if (! empty ( $_POST [ 'sub' ])) { $kfzwname = escape( $_POST [ 'kfzwname' ], 'string' ); $kfzwbeschreibung = escape( $_POST [ 'kfzwbeschreibung' ], 'string' ); $kfzwstr = escape( $_POST [ 'kfzwstr' ], 'string' ); $kfzwhnr = escape( $_POST [ 'kfzwhnr' ], 'integer' ); $kfzwhnrzusatz = escape( $_POST [ 'kfzwhnrzusatz' ], 'string' ); $kfzwplz = escape( $_POST [ 'kfzwplz' ], 'integer' ); $kfzwort = escape( $_POST [ 'kfzwort' ], 'string' ); $kfzwtelefon = escape( $_POST [ 'kfzwtelefon' ], 'string' ); $kfzwmobil = escape( $_POST [ 'kfzwmobil' ], 'string' ); $kfzwemail = escape( $_POST [ 'kfzwemail' ], 'string' ); $kfzwsite = escape( $_POST [ 'kfzwsite' ], 'string' ); $kfzwfax = escape( $_POST [ 'kfzwfax' ], 'string' ); $kfzwbild = $_FILES [ 'bild' ]; $pid = db_result(db_query( "SHOW TABLE STATUS FROM `" . DBDATE . "` LIKE 'prefix_kfzwerkstatt'" ),0, 'Auto_increment' ); $data_maxsize = "1048576" ; if (isset( $_POST [ 'sub' ])){ if (! empty ( $kfzwbild [ 'name' ])){ $dateityp = GetImageSize ( $kfzwbild [ 'tmp_name' ]); if ( $dateityp [2] == 0) { $fehler .= "<li>Bitte im Feld 'Bild' nur ein Bild im Gif bzw. jpg Format hochladen</li>" ; } } else { $fehler .= "<li>Das Feld 'Bild' wurde nicht korrekt ausgefüllt!</li>" ; }} if ( empty ( $_POST [ 'sid' ]) ) { $pid = db_result(db_query( "SHOW TABLE STATUS FROM `" . DBDATE . "` LIKE 'prefix_kfzwerkstatt'" ),0, 'Auto_increment' ); $explode = explode ( "." , $kfzwbild [ 'name' ]); $count = count ( $explode )-1; $endung = $explode [ $count ]; db_query('INSERT INTO `prefix_kfzwerkstatt` ( kfzwname, kfzwbeschreibung, kfzwstr, kfzwhnr, kfzwhnrzusatz, kfzwplz, kfzwort, kfzwtelefon, kfzwmobil, kfzwemail, kfzwsite, kfzwfax, kfzwbild) VALUES ( "'.$kfzwname.'" , "'.$kfzwbeschreibung.'" , "'.$kfzwstr.'" , "'.$kfzwhnr.'" , "'.$kfzwhnrzusatz.'" , "'.$kfzwplz.'" , "'.$kfzwort.'" , "'.$kfzwtelefon.'" , "'.$kfzwmobil.'" , "'.$kfzwemail.'" , "'.$kfzwsite.'" , "'.$kfzwfax.'" , "kfzwerkstatt_'.$pid.''.$endung.'" ) ' ); } else { $sid = escape( $_POST [ 'sid' ], 'integer' ); db_query('UPDATE `prefix_kfzwerkstatt` SET kfzwname = "'.$kfzwname.'" , kfzwbeschreibung = "'.$kfzwbeschreibung.'" , kfzwstr = "'.$kfzwstr.'" , kfzwhnr = "'.$kfzwhnr.'" , kfzwhnrzusatz = "'.$kfzwhnrzusatz.'" , kfzwplz = "'.$kfzwplz.'" , kfzwort = "'.$kfzwort.'" , kfzwtelefon = "'.$kfzwtelefon.'" , kfzwmobil = "'.$kfzwmobil.'" , kfzwemail = "'.$kfzwemail.'" , kfzwsite = "'.$kfzwsite.'" , kfzwfax = "'.$kfzwfax.'" , kfzwbild = "kfzwerkstatt_'.$sid.'.'.$endung.'" WHERE id = "'.$sid.'" '); $bild_norm = "include/images/kfzwerkstatt/" . $pid . "_kfzwerkstatt." . $endung ; } } if (! empty ( $_GET [ 'delete' ]) ) { $delete = escape( $_GET [ 'delete' ], 'integer' ); db_query( 'DELETE FROM `prefix_kfzwerkstatt` WHERE id = "' . $delete . '" LIMIT 1' ); } if ( empty ( $_GET [ 'sid' ]) ) { $row = array (); $row [ 'sub' ] = 'Eintragen' ; $row [ 'kfzwname' ] = '' ; $row [ 'kfzwstr' ] = '' ; $row [ 'kfzwhnr' ] = '' ; $row [ 'kfzwhnrzusatz' ] = '' ; $row [ 'kfzwplz' ] = '' ; $row [ 'kfzwort' ] = '' ; $row [ 'kfzwtelefon' ] = '' ; $row [ 'kfzwmobil' ] = '' ; $row [ 'kfzwemail' ] = '' ; $row [ 'kfzwsite' ] = '' ; $row [ 'kfzwfax' ] = '' ; $row [ 'kfzwbild' ] = '' ; $row [ 'kfzwbeschreibung' ] = $row [ 'sid' ] = '' ; } else { $abf = 'SELECT kfzwname,kfzwbeschreibung,kfzwstr,kfzwhnr,kfzwhnrzusatz,kfzwplz,kfzwort,kfzwtelefon,kfzwmobil,kfzwemail,kfzwsite,kfzwfax,kfzwbild, id as sid FROM `prefix_kfzwerkstatt` WHERE id = "' .escape( $_GET [ 'sid' ], 'integer' ). '"' ; $erg = db_query( $abf ); $row = db_fetch_assoc( $erg ); $row [ 'sub' ] = 'Ändern' ; } $clas = '' ; $tpl = new tpl ( 'kfzwerkstatt' , 1); $tpl ->set_ar_out( $row ,0); $erg = db_query( 'SELECT * FROM `prefix_kfzwerkstatt` ORDER BY id' ); while ( $row = db_fetch_assoc( $erg ) ) { $clas = ( $clas == 'Cmite' ? 'Cnorm' : 'Cmite' ); $row [ 'class' ] = $clas ; $tpl ->set_ar_out( $row ,1); } $tpl ->out(2); $design ->footer(); ?> |
in der DB wird das dann wie folgt abgespeichert:
kfzwerkstatt.. <-- hier fehlt aber die Dateiendung.
Hat jemand einen Tipp für mich, was da schief läuft?