Sponsor-Board.de
PHP - $_FILES-Array will nicht wie ich will!

+- Sponsor-Board.de (https://www.sponsor-board.de)
+-- Forum: Webmaster (/forumdisplay.php?fid=44)
+--- Forum: Script-Check (/forumdisplay.php?fid=91)
+--- Thema: PHP - $_FILES-Array will nicht wie ich will! (/showthread.php?tid=27126)


PHP - $_FILES-Array will nicht wie ich will! - MrCentury - 21.06.2012 22:39

Ich komm direckt zur Sache.
Das ist mein Code:

PHP-Code:
<?php

        
if(isset($_POST['submit'])){
            if(isset(
$_FILES['song']['name'])) {
                
$song_name $_FILES['song']['name'];
            } else {
                
$song_name "-";
            }
            if(isset(
$_FILES['song']['tmp_name'])){
                
$song_tmp_name $_FILES['song']['tmp_name'];
            } else {
                
$song_tmp_name "-";
            }
            if(isset(
$_FILES['song']['size'])){
                
$song_size $_FILES['song']['size'];
            } else {
                
$song_size "-";
            }
            if(isset(
$_FILES['song']['type'])){
                
$song_type $_FILES['song']['type'];
            } else {
                
$song_type "-";
            }
            if(isset(
$_POST['name'])){
                
$name $_POST['name'];
            }
            if(isset(
$_POST['email'])){
                
$email $_POST['email'];
            }
            echo 
"Dein Song wird zur Überprüfung an einen Administrator gesendet und wird
            in kürze zur Verfügung stehen!<br><br>"
;
            echo 
"<b>Song-Informationen:</b><br>";
            echo 
"Dateiname: ".$song_name."<br>";
            echo 
"Dateigroesse: ".$song_size."<br>";
            echo 
"Dein Name: ".$name."<br>";
        } else  {

?>
    <div id="currently_playing_wrapper">
                <div id="currently_playing">
                <table cellpadding="0" cellspacing="0">
                <form action="ul.php" method="post">
                        <thead>
                            <tr>
                                <th align="left" style="width: 170px;">
                                    Song Uploaden
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td align="center">
                                    Song Ausw&auml;hlen:<br /><br /><hr />
                                    Dein Name:<br /><br />
                                    Deine E-Mail Adresse:<br />
                                </td>
                                <td colspan="2">                    
                                    <input type="file" name="song" ><br /><br /><br />
                                    <input type="text" name="name"><br /><br />    
                                    <input type="text" name="email"><br />                                
                        
                                </td>
                                <td align="right">
                                    <input type="submit" name="submit" value="Song Hochladen!">
                                </form>
                                </td>
                            </tr>
                        </tbody>
                    </table>
            </form>
            </div></div>
        <?php
        
}
?>


Ich kan die Informationen von der Datei nicht Abrufen. Was hab ich falsch gemacht?? Bei Bedarf auch Teamviewer.
Hoffe auf Antwort Smile

MFG


RE: PHP - $_FILES-Array will nicht wie ich will! - _DEL7456 - 21.06.2012 22:41

-


RE: PHP - $_FILES-Array will nicht wie ich will! - Dennis - 21.06.2012 22:42

enctype="multipart/form-data"

das attribut fehlt noch im formtag, damit uploads funktionieren.


RE: PHP - $_FILES-Array will nicht wie ich will! - MrCentury - 21.06.2012 22:49

@deinsponsoring.de, Danke, aber hat sich durch die Antwort von dlite schon Erledigt

@dlite, das war es! Dankee!!