marnix Posted October 28, 2005 Report Share Posted October 28, 2005 Man ir kods faila uploudošanai tik man viņš nestrādā..... Es esmu pārāk zaļš tādēļ es nezinu kas tur jālabo????? Varbūt kāds var pateikt kas par vainu.. <!-- The data encoding type, enctype, MUST be specified as below --> <form enctype="multipart/form-data" action="pictures/generate.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="userfile" type="file" /> <input type="submit" value="Send File" /> </form> Link to comment Share on other sites More sharing options...
v3rb0 Posted October 28, 2005 Report Share Posted October 28, 2005 tur tev nav viss kods. Link to comment Share on other sites More sharing options...
marnix Posted October 28, 2005 Author Report Share Posted October 28, 2005 kas tad man trūkst?? Link to comment Share on other sites More sharing options...
v3rb0 Posted October 28, 2005 Report Share Posted October 28, 2005 fails pictures/generate.php Link to comment Share on other sites More sharing options...
marnix Posted October 28, 2005 Author Report Share Posted October 28, 2005 tas man ir bet tomēr man kautkas neiet.. <?php // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead // of $_FILES. $uploaddir = 'pict/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; ?> Link to comment Share on other sites More sharing options...
marnix Posted October 28, 2005 Author Report Share Posted October 28, 2005 Es nezinu kas par kļūdu.. viņš man met ārā tādu erroru.. Possible file upload attack! Here is some more debugging info:Array ( [userfile] => Array ( [name] => IMGP8393.JPG [type] => [tmp_name] => [error] => 2 => 0 ) ) Link to comment Share on other sites More sharing options...
marnix Posted October 28, 2005 Author Report Share Posted October 28, 2005 ja kāds zin tad LŪDZU pasakat... :D Link to comment Share on other sites More sharing options...
v3rb0 Posted October 28, 2005 Report Share Posted October 28, 2005 apskaties http://lv2.php.net/manual/en/features.file-upload.errors.php un tu dabuu [error] => 2 taalaak pac izdoma. Link to comment Share on other sites More sharing options...
marnix Posted October 28, 2005 Author Report Share Posted October 28, 2005 aaa. sapratu.. tas ir saistīts ar uploudojamā faila izmēru... Link to comment Share on other sites More sharing options...
marnix Posted October 28, 2005 Author Report Share Posted October 28, 2005 (edited) aa vēl viena lieta .. esmu sameistarojis kautkādu skriptu un man tagad vinš met ārā kautkādu stulbu erroru... man nau ne jausmas ko tajā rindā izdarīt Warning: Invalid argument supplied for foreach() in c:\web\easyphp1-8\www\generate.php on line 15 15 rinda ir iekrāsota.... <? $name = $_POST['Naktsmitnes_veids']; $text = $_POST['Nosaukums']; $file=fopen($text.".html", 'w+'); fputs($file,"<h3><strong>$name '$text'</strong></h3><br> <img src='icons/$name.gif' alt='$name'>"); fclose($file); ?> <? $links = ("$name,links"); $file=fopen($links.".html",'a'); fputs($file,"<a href='$text.html'>$name '$text'</a><br>"); fclose($file); ?> <?php foreach ($_FILES["pictures"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK) { $tmp_name = $_FILES["pictures"]["tmp_name"][$key]; $name = $_FILES["pictures"]["name"][$key]; move_uploaded_file($tmp_name, "$name"); } } ?> Edited October 28, 2005 by marnix Link to comment Share on other sites More sharing options...
SkaKri Posted October 28, 2005 Report Share Posted October 28, 2005 http://lv.php.net/features.file-upload Link to comment Share on other sites More sharing options...
marnix Posted October 28, 2005 Author Report Share Posted October 28, 2005 to jau es ņēmu bet tas neder... man derētu louders kas vairākus failus reizē uploudo.. tas kas man tagad ir tiki tur ir neliela ķļūda tikai es nezinu kāda tādēļ es jau jums prasu.. Link to comment Share on other sites More sharing options...
SkaKri Posted October 28, 2005 Report Share Posted October 28, 2005 apskaties tur muoihv at 1yt dot net skriptu.. varbūt labāk der (kā nekā, ja vajag tik attēlus uploadot)?.... un pats vari tālāk domāt, kas un kā, ko mainīt/izmest/pievienot. Link to comment Share on other sites More sharing options...
marnix Posted October 28, 2005 Author Report Share Posted October 28, 2005 (edited) jā šito skriptu es no turienes ņēmu.. šitais ir vienīgas no visiem kas man der ...kā jau iepriekš teicu kad es nezinu kas par kļūdu šajā skriptā....es cerētu uzzināt kāda tur kļūda īsti ir... Paldies par pūlēm :D Edited October 28, 2005 by marnix Link to comment Share on other sites More sharing options...
SkaKri Posted October 28, 2005 Report Share Posted October 28, 2005 šitais ir vienīgas no visiem kas man der ... 25721[/snapback] tad stāsti, kas der? Link to comment Share on other sites More sharing options...
Recommended Posts