Also ich habe in der Datenbank eine Tabelle angelegt Namens Test und dann darin eine Struktur Bild.
Jetzt hatte ich folgendes versucht
php
<?php defined ('main') or die ( 'no direct access' ); defined ('admin') or die ( 'only admin access' ); $design = new design ('Admins Area', 'Admins Area', 2); $design->header(); $tpl = new tpl ( 'testup', 1); if ( empty ($_POST['submit']) ) { $abf = 'SELECT bild FROM `prefix_test`'; $erg = db_query($abf); if ( db_num_rows($erg) > 0 ) { $row = db_fetch_assoc($erg); $row['avatarbild'] = ( file_exists ( $row['bild'] ) ? '<img src="'.$row['bild'].'" alt=""><br />' : '' ); $row['Fabreite'] = $allgAr['Fabreite']; $row['Fahohe'] = $allgAr['Fahohe']; $row['Fasize'] = $allgAr['Fasize']; $row['ppicbreite'] = $allgAr['ppicbreite']; $row['ppichohe'] = $allgAr['ppichohe']; $row['ppicsize'] = $allgAr['ppicsize']; $row['forum_max_sig'] = $allgAr['forum_max_sig']; $row['uid'] = $_SESSION['authid']; $row['forum_usergallery'] = $allgAr['forum_usergallery']; $tpl->set_ar_out($row,0); if ($allgAr['forum_avatar_upload']) $tpl->out(1); $tpl->set_ar_out($row,2); profilefields_change ( $_SESSION['authid'] ); $tpl->out(3); # avatar speichern START $avatar_sql_update = ''; if ( !empty ( $_FILES['bildfile']['name'] ) AND $allgAr['forum_avatar_upload'] ) { $file_tmpe = $_FILES['bildfile']['tmp_name']; $rile_type = ic_mime_type ($_FILES['bildfile']['tmp_name']); $file_type = $_FILES['bildfile']['type']; $file_size = $_FILES['bildfile']['size']; $fmsg = $lang['avatarisnopicture']; $size = @getimagesize ($file_tmpe); $endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png'); if ( ($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ( $file_type , 0 , 6 ) == 'image/' AND substr ( $rile_type , 0 , 6 ) == 'image/' ) { $endung = $endar[$size[2]]; $breite = $size[0]; $hoehe = $size[1]; $fmsg = $lang['avatarcannotupload']; if ( $file_size <= $allgAr['Fasize'] AND $breite <= $allgAr['Fabreite'] AND $hoehe <= $allgAr['Fahohe'] ) { $neuer_name = 'include/images/avatars/'.$_SESSION['authid'].'.'.$endung; @unlink (db_result(db_query("SELECT bild FROM prefix_test WHERE id = ".$_SESSION['authid']),0)); move_uploaded_file ( $file_tmpe , $neuer_name ); @chmod($neuer_name, 0777); $avatar_sql_update = "bild = '".$neuer_name."',"; $fmsg = $lang['pictureuploaded']; } } } elseif ( isset($_POST['bildloeschen']) ) { $fmsg = $lang['picturedelete']; @unlink (db_result(db_query("SELECT bild FROM prefix_test WHERE id = ".$_SESSION['authid']),0)); $avatar_sql_update = "bild = '',"; } } # avatar speichern ENDE $design->footer(); } ?>
html
<tr> <td class="Cmite">Bild</td> <td class="Cnorm"><input type="checkbox" name="bilddel" value="1">Löschen ?<br /> {bild} <input type="file" name="bildfile" /></td> </tr> </td></tr> <tr> <td class="Cdark"></td> <td class="Cdark"> <input type="submit" value="Ändern" name="submit"> </td> </tr> </table> </form>
Aber leider Funktioniert der Ändern Button nicht.
Könnte mir da jemand behilflich sein?
Mit Freundlichen Grüßen
Lisa
betroffene Homepage: localhost