Dear All. I ma trying to write a script that let the user choose how many languages to upload. Therefore the first script checks weather the user has choosed to add images, if not, he'll get a preview of the web site; otherwise array_padd will increment the array for the number of images the user has choosen: <?php if(($add == "") or ($add == "0")){ $description= wordwrap($description,50,"<br>"); echo "<table frame=\"border\"> <tr><th>$font1 PREVIEW DEL SITO</font></th></tr> <tr><td colspan=\"2\" align=\"left\"><img src=\"../ecom/$u/$logo_name\"></td></tr> <tr><td>$description</td><td><img src=\"../ecom/$u/$img_az_name\"></td></tr> </table>"; }else{ $img = array('img','desc'); $img = array_pad($img, $add, ''); echo "<table> <tr><th colspan=\"6\">$font1 GESTIONE SITO - Add images</font></th> <form action=\"./panel.php\" method=\"post\" enctype=\"multipart/form-data\"> <input type=\"hidden\" name=\"servizio\" value=\"4\"> <input type=\"hidden\" name=\"visione\" value=\"imdone\">"; foreach($img as $k => $img){ $k++; echo "<tr><td>$font1 Image $k: </font></td> <td><input type=\"file\" name=\"img[$k]\"></td> <td>$font1 Title: </font></td> <td><input type=\"text\" name=\"title[$k]\" maxlength=\"50\"></td> <td>$font1 Description: </font></td> <td><textarea name=\"desc[$k]\"></textarea></td> </tr>"; } ?>
The second script would be: <?php $uploaddir = "/web/htdocs/www.example.it/home/ecom/$u/"; $uploadfile = $uploaddir.$_FILES['img']['name']; print "<pre>"; if (move_uploaded_file($HTTP_POST_FILES['img']['tmp_name'], $uploadfile)) { print "File is valid, and was successfully uploaded. "; print "Here's some more debugging info:\n"; print_r($HTTP_POST_FILES); } else { print "Possible file upload attack! Here's some debugging info:\n"; print_r($HTTP_POST_FILES); } print "</pre>"; ?> I keep on getting a possible upload file attack. The debugging info says there are no errors. I have tried using $_FILES instead of $HTTP_POST_FILES. My ISP has Gobals turned on and max file size is 8 MB, in this example I have been using 2 files of 246K each. Where do you think the problem might lay? Thank you, Gennaro Losappio ____________________________________________________________ Yahoo! Companion - Scarica gratis la toolbar di Ricerca di Yahoo! http://companion.yahoo.it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php