File upload...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • djpaul
    New Member
    • Oct 2006
    • 137

    File upload...

    Hmm, damn, why does this not work??
    Code:
    echo '<div id="edittext"><form method="post" action="" enctype="multipart/form-data">
    						  <textarea name="txtarea" id="textfield">' . $edit['text'] . '</textarea><br />
    						  <input type="file" name="photo" value="Selecteer een foto" size="50" /><br />
    						  <font color="white">' . $edit['photo'] . '</font><br />
    						  <input type="hidden" name="id" value="' . $edit['id'] . '" />
    						  <input type="hidden" name="section" value="' . $section . '" />						  
    						  <input type="submit" name="save" value="Opslaan" /></form></div>';
    And the second section...

    Code:
    }elseif( isset( $_REQUEST['save'] )){
    			
    			$ID		 = (int) trim(mysql_real_escape_string( $_REQUEST['id'] ));
    			$section = $_REQUEST['section'];
    			$newtext = mysql_real_escape_string( stripslashes( $_REQUEST['txtarea'] ));
    			
    				if( isset( $_FILES['photo'] )){
    					
    					$foto = strtolower( $_FILES['photo']['name'] );
    					$tmp  = $_FILES['photo']['tmp_name'];
    					
    				}.....
    My $_FILES['photo'] is always empty.

    Thanks!
    Greetz,
    Paul
  • djpaul
    New Member
    • Oct 2006
    • 137

    #2
    Ah, i found the problem.
    Above this part there was another form. but it was not closed properly.
    It said: <form method="post">< form>
    Of course this must be </form>.

    Thanks!

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      No problem! (Literally xD)
      Glad you solved it ;-)

      Comment

      Working...