Mikijs Posted February 20, 2008 Report Share Posted February 20, 2008 (edited) Sveiki forumiesi, naku pec nelielas plidzibas =[ gribu vienlaicigi uploadot 3 bildes, bet man problema Kods $bilde=$_FILES["bilde"]; $a_bilde=$_FILES['a_bilde']; $love_bilde=$_FILES['love_bilde']; $file_ext=strtolower(substr($bilde[name], strrpos($bilde[name], "."))); //Parbaudam 1 if($file_ext==".jpg" OR $file_ext==".jpeg" OR $file_ext==".png") { $fails=date(Ymd).time().md5($bilde[name]).$file_ext; $res = move_uploaded_file($bilde[tmp_name], WWW."profils/atteli/".$fails); @chmod($bilde[name], 0755); $info .= 'Kopbilde: '.$fails.'<br />'; }else{ $error .= "Pārliecinies vai kopbildes bilde ir JPG, vai PNG fails!<br />"; } //Parbaudam 2 $a_file_ext=strtolower(substr($a_bilde[name], strrpos($a_bilde[name], "."))); if($a_file_ext==".jpg" OR $a_file_ext==".jpeg" OR $a_file_ext==".png") { $a_fails=date(Ymd).time().md5($a_bilde[name]).$a_file_ext; $a_res = move_uploaded_file($a_bilde[tmp_name], WWW."profils/atteli/".$a_fails); @chmod($a_bilde[name], 0755); $info .= 'Kopbilde: '.$a_fails; }else{ $error .= "Pārliecinies vai puiša bilde ir JPG, vai PNG fails!<br />"; } //Parbaudam 3 $love_file_ext=strtolower(substr($love_bilde[name], strrpos($love_bilde[name], "."))); if($love_file_ext==".jpg" OR $love_file_ext==".jpeg" OR $love_file_ext==".png") { $love_fails=date(Ymd).time().md5($love_bilde[name]).$love_file_ext; $love_res = move_uploaded_file($love_bilde[tmp_name], WWW."profils/atteli/".$love_fails); @chmod($love_bilde[name], 0755); $info .= 'Kopbilde: '.$love_fails.'<br />'; }else{ $error .= "Pārliecinies vai meitenes bilde ir JPG, vai PNG fails!<br />"; } Blaviens =[ .. 1. bilde neaugsupieladejas 2. rada errrors ar extension, bet bildes lieku ar jpg Edited February 20, 2008 by Mikijs Link to comment Share on other sites More sharing options...
Mikijs Posted February 20, 2008 Author Report Share Posted February 20, 2008 noderetu kada atbilde ;) Link to comment Share on other sites More sharing options...
Aleksejs Posted February 20, 2008 Report Share Posted February 20, 2008 Un ko Tu esi darījis lietas labā? Es parasti debugošanu sāku ar visādu mainīgo, kuri ietekmē programmas gaitu izechošanu... Link to comment Share on other sites More sharing options...
Mikijs Posted February 20, 2008 Author Report Share Posted February 20, 2008 esmu ticis shitik talu, talak vinjs man neko nedara ka vienigi saka ka ekstensio nav pareizais bet kods ir pareizs esmu simulejis ar mainigajiem bet ta vai ta tas apts.. Link to comment Share on other sites More sharing options...
Aleksejs Posted February 20, 2008 Report Share Posted February 20, 2008 Uzraksti pēc tā kļūdas paziņojuma: echo('{'.$a_file_ext.'}'); print_r($a_bilde); un tad sāc izdarīt secinājumus. Link to comment Share on other sites More sharing options...
bubu Posted February 20, 2008 Report Share Posted February 20, 2008 Ja jau saka, ka nav pareizais, tad nav pareizais. Un btw, par funkcijām vai cikliem esi dzirdējis? Link to comment Share on other sites More sharing options...
Mikijs Posted February 20, 2008 Author Report Share Posted February 20, 2008 hmz.. tuksums.. Link to comment Share on other sites More sharing options...
Aleksejs Posted February 20, 2008 Report Share Posted February 20, 2008 (edited) Kā lai saprot šo rindiņu: $res = move_uploaded_file($bilde[tmp_name], WWW."profils/atteli/".$fails); Kas tas WWW par zvēru, ko? un ja jau meklē kļūdas, tad: error_reporting(E_ALL); ini_set('display_errors','On'); P.S. Ko nozīmē tukšums? Pat figūriekavas neizdrukā? Tad jau nemāki atrast vietu, kur izvada kļūdu! P.P.S. Esi pārliecināts, ka tā forma, kas nosūta datus, nosūta tos korekti... Vai neesi katru input type=file ielicis atsevišķā formā? Edited February 20, 2008 by Aleksejs Link to comment Share on other sites More sharing options...
Klez Posted February 21, 2008 Report Share Posted February 21, 2008 (edited) formai atribuuts enctype ir "multipart/form-data" ? kaa jau bubu teica paskaties kas ir cikls un funkcija piemeeram: function uplaudo($src,$dest) { if (visas_parbaudes_izturetas()){ move_uploaded_file(...); } else echo 'neatljauts faila formats'; } uplaudo("/source/fails/1","/kur/saglabat/failu"); uplaudo("/source/fails/2","/kur/saglabat/failu"); un papeeti kaa draugiem.lv pievieno bildes. Edited February 21, 2008 by Klez Link to comment Share on other sites More sharing options...
Recommended Posts