Hilfe bei PHP Upload

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

  • Hilfe bei PHP Upload

    Hallo

    ich habe ein php upload erstellt es funktioniert alles gut nur ein kleines fehler ist das beim hochladen von File lädt der cod nicht ins bestimter ordner.

    config.inc.php
    PHP-Code:
    <?php
    // --------------> Config
    // promotion script Pfad ohne /
    $pfad                    =    "http://www.beispiel.de/promotion";
    // zusende e-Mail
    $mail                    =    "info@Mustermann.de";
    // e-Mail betreff angeben
    $betreff                =    "Neuer Musikupload";
    // max. upload größe in MB
    $maxupload                =    "10";
    // upload ordner ohne /
    $uploadziel                =    "upload";
    // ----------------------------------------------------------
    // --------------> Hab hier bitte nichts mehr ändern!
    $maxuploads                =    $maxupload 1000000;
    $interpret                =    $_POST["interpret"];
    $titel                    =    $_POST["titel"];
    $email                    =    $_POST["email"];
    $genre                    =    $_POST["genre"];
    $bereich                =    $_POST["b"];
    $upload                    =    $_FILES['upload']['name'];
    $date                    =    date("d.m.Y - G:i");
    // ----------------------------------------------------------
    // --------------> Config
    // e-Mail nachricht
    $message                =    "Text:

    Interpret: 
    $interpret
    Titel: 
    $titel
    e-Mail: 
    $email
    Genre: 
    $genre
    Bereich: 
    $bereich
    Upload Datum: 
    $date
    Upload Track: 
    $upload

    Download: 
    $pfad/$uploadziel/$upload
    "
    ;
    ?>
    music-upload.php
    PHP-Code:
    <?php
    include("config.inc.php");
    ?>
    <head>
    <meta http-equiv="Content-Language" content="ru">
    <TITLE>Titel!</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252"><LINK 
    href="style/style.css" type=text/css rel=stylesheet>
    <style>
    <!--
        div{
            margin:0;
            padding:0;
        }
    .Stil15 {font-size: 14px; font-weight: bold; color: #00FFFF; }
    .Stil17 {font-size: 16px}
    .Stil13 {font-size: 12px}
    .error {color: #FF0000;}
    .erfolg {color: #00FF00;}
    -->
    </style>
    </HEAD>
    <BODY bgproperties="fixed" background="../images/behind.JPG">
    <form action="" method="post" enctype="multipart/form-data">
      <table width="531" align="center" cellpadding="0" cellspacing="0">
        <tr>
        <td height="18"  align="left" valign="top" ><table width="100%" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td  align="left" valign="top" class="artiketitelbg"><table width="100%" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td  align="left" valign="top" class="artiketitel">MP3-Upload</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td  align="left" valign="top" class="artikeltxt" ><table width="100%" height="1" cellpadding=0 cellspacing=1>
              <tr>
                <td  height="20" align="center"><div class="Stil15 Stil17" align="center"  height: 44">
                  <table cellpadding="0" width="400" border="0"  cellspacing="0" height="22">
                    <tr>
                      <td align="middle" width="197"  height="1" style="border-style: none; border-width: medium"><div class="Stil13" align="center"> <strong><font size="1">MP3</font></strong></div></td>
                      <td align="middle" width="189"  height="1" style="border-style: none; border-width: medium"><div class="Stil13" align="center"> <strong><font size="1">Promo</font></strong></div></td>
                    </tr>
                    <tr >
                      <td height="20"   style="border-style: none; border-width: medium"><div align="center">
                        <input type="radio" value="MP3" name="b">
                      </div></td>
                      <td height="20"  style="border-style: none; border-width: medium"><div align="center">
                        <input type="radio" value="Promo" name="b">
                      </div></td>
                    </tr>
                  </table>
                  <?php
    if(isset($_POST["do"]) && $_POST["do"] == "insert")
    {
        if(empty(
    $_POST["interpret"]) || empty($_POST["titel"]) || empty($_POST["email"]) || empty($_FILES['upload']['name']))
        {
            echo 
    "<strong class='error'>Bitte alle Felder ausf&uuml;llen!</strong>";
        }
        else
        {
            if(
    $_FILES['upload']['size'] > $maxuploads)
            {
                echo 
    "<strong class='error'>Bitte nicht mehr als $maxupload MB Hochladen!</strong>";
            }
            else
            {
                
    $format            =    $_FILES['upload']['name'];
                if(
    strtolower(substr($format, -4)) == ".mp3" || substr($format, -4) == ".MP3")
                {
                    
    move_uploaded_file($_FILES['upload']['tmp_name'], $uploadziel.'/'.basename($_FILES['upload']['name']));
                    
    mail($mail$betreff$message);
                    echo 
    "<strong class='erfolg'>Erfolgreich hochgeladen...Wir melden uns so schnell wie es nur geht!</strong>";
                    echo 
    "<br><br>Upload Track: " $_FILES['upload']['name'];
                }
                else
                {
                    echo 
    "<strong class='error'>Bitte nur MP3 dateien Hochladen.</strong>";
                }
            }
        }
    }
    ?>
                </div>
                  <table cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tr>
                      <td height="26" align="right">Interpret:*</td>
                      <td width="75%" height="26" align="left">&nbsp; <?php echo '<input name="interpret" size="40" type="text">'?></td>
                    </tr>
                    <tr>
                      <td height="26" align="right">Titel:*</td>
                      <td width="75%" height="26" align="left">&nbsp; <?php echo '<input name="titel" size="40" type="text">'?></td>
                    </tr>
                    <tr>
                      <td height="26" align="right">E-Mail:*</td>
                      <td height="26" width="75%" align="left">&nbsp; <?php echo '<input name="email" size="40" type="text">'?></td>
                    </tr>
                    <tr>
                      <td height="26" align="right">Genre:*</td>
                      <td height="26" width="75%" align="left">&nbsp; <?php echo '<select name="genre">
                              <option>Rap</option>
                              <option>Hip Hop</option>
                              <option>RnB</option>
                              <option>Pop</option>
                              <option>Shancon</option>
                              <option>Remix</option>
                              <option>House</option>
                              <option>Techno</option>
                          </select>'
    ?></td>
                    </tr>
                    <tr>
                      <td height="26" align="right"><p style="margin-top: 0; margin-bottom: 0">Upload:*</td>
                      <td height="26" width="75%" align="left">&nbsp; <?php echo '<input name="upload" type="file" size="30">'?></td>
                    </tr>
                    <tr>
                      <td height="0" align="right">&nbsp;</td>
                      <td width="75%" height="0" align="left">&nbsp;&nbsp;
                        <?php  echo "<strong>Nur MP3 Format!</strong>"?></td>
                    </tr>
                    <tr>
                      <td height="0" align="right">&nbsp;</td>
                      <td height="0" width="75%" align="left">&nbsp;&nbsp;<?php echo "max. <strong>" $maxupload "</strong> MB"?></td>
                    </tr>
                    <tr>
                      <td height="38" align="right">&nbsp;</td>
                      <td height="38" width="75%" align="left">&nbsp; <?php echo '<input name="do" value="insert" type="hidden"><input name="submit" value="MP3 Hochladen" type="submit">
                            <input name="reset" value="Reset" type="reset">'
    ?></td>
                    </tr>
                  </table></td>
              </tr>
              
            </table></td>
          </tr>
          <tr>
            <td  align="left" valign="top" bgcolor="#151515" ><table width="100%" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="12" rowspan="2"  align="left" valign="bottom" ><img src="images/main_UNDER__r1_c1.jpg" width="12" height="15" /></td>
                <td height="12"  align="right" valign="top" class="minilinkinfo"></td>
                <td width="12" rowspan="2"  align="right" valign="bottom" ><img src="images/main_UNDER__r1_c5.jpg" width="12" height="15" /></td>
              </tr>
              <tr>
                <td height="8"  align="left" valign="top" background="images/main_UNDER__r1_c3.jpg"><img src="images/1px.gif" width="1" height="8" /></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table>
    </form>
    <BR>

    </BODY>

  • #2
    Bitte brich deinen Code um! Keiner scrollt gerne kilometerweit horizontal. Dann verrate ich dir auch die Lösung.

    Peter
    Nukular, das Wort ist N-u-k-u-l-a-r (Homer Simpson)
    Meine Seite

    Kommentar


    • #3
      ... und hier findest Du die Lösung Deines Problems: ...
      Bitte schau explizit nach ...().
      EDIT:
      Sorry, kein umbrochener Code, keine Lösung. Ist zwar nett gemeint von dir, aber erzieht die Forumsmitglieder nicht.
      Peter

      Zuletzt geändert von Kropff; 21.07.2011, 11:36. Grund: Link entfert, da TS Code noch nicht umbrochen hat.
      MM Newmedia | MeinBlog

      Kommentar

      Lädt...
      X