Cerka Posted February 28, 2007 Report Share Posted February 28, 2007 Es dabuju upload scriptu! Seit ir Scripts no paste.php.lv! Faili man uplodojas bet rada sitadu etotu Warning: Invalid argument supplied for foreach() in C:\AppServ\www\upload.php on line 11 Link to comment Share on other sites More sharing options...
andrisp Posted February 28, 2007 Report Share Posted February 28, 2007 Tiešām faili uploadējas ? Šito tev nevajag vispār: foreach ($_FILES["pictures"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK) { Cik zinu, tad $_FILES["pictures"]["error"] nav un nevar būt masīvs. Un UPLOAD_ERR_OK nekur netiek nodefinēts. Link to comment Share on other sites More sharing options...
Cerka Posted February 28, 2007 Author Report Share Posted February 28, 2007 sito man jaliek tiesi kur?:D Link to comment Share on other sites More sharing options...
andrisp Posted February 28, 2007 Report Share Posted February 28, 2007 Izlasi vēlreiz ko es rasktīju - tev to daļu nevajag vispār. Tagad iebraucu, ka UPOAD_ERR_OK tur bija domāts kā strings. Tā foreach un if vietā ieliec vienkārši: if(isset($_FILES["pictures"]) && $_FILES["pictures"]["error"] == 'UPLOAD_ERR_OK') { // veicam uplaodu } Kā arī iekš formas nevis pictures[] bet gan vienkārši pictures vai picture. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 28, 2007 Report Share Posted February 28, 2007 (edited) Cik zinu, tad $_FILES["pictures"]["error"] nav un nevar būt masīvs. Tieshaam !?! Un kas ir shis ? -------------- $_FILES['userfile']['error'] The error code associated with this file upload. This element was added in PHP 4.2.0 -------------- Un sajaa gadijumaa 'userfile' Vienkarshi nosaukts par "pictures" Edit: andrisp --> aizbrauca par ko ir Runa ... Edited February 28, 2007 by Grey_Wolf Link to comment Share on other sites More sharing options...
andrisp Posted February 28, 2007 Report Share Posted February 28, 2007 Grey_Wolf, ir masīvs $_FILES. Bet tu jau laikam saprati. Link to comment Share on other sites More sharing options...
Recommended Posts