0

名前が「foto」の入力タイプファイルがあるフォームがあります

目標は、データベースに入る前に、ユーザーがアップロードしている写真のサイズを変更することです。

主なエラーは、送信をクリックすると、ページに次のような奇妙なコードが大量に表示されることです。

����JFIF��m���b~bs�I$��'$V�ڳ�v,HL���rr0{ �r�I4����nCT�����O���%�vw|��;��[쯧��!VOݓI&Ҽ�M춶��o�Z�ѥ��Vb���������� ۧ��b��zi8Pr�%�9 ��猞3!�Dx�,U�8t�F�cМ�X��lP�

送信をクリックすると、次の手順を実行します

$fFoto="";

if($_FILES['foto']['error'] == UPLOAD_ERR_OK) {

     $fFile="/upload/inserzionisti/".$id."_".$_FILES["foto"]["name"];
     $fFoto=$id."_".$_FILES["foto"]["name"];

     $percent = 0.5;

     list($width,$height) = getimagesize("upload/inserzionisti/".$fFoto."");
     $new_width = $width * $percent;
     $new_height = $height * $percent;

     $image_p = imagecreatetruecolor($new_width,$new_height);
     $image = imagecreatefromjpeg("upload/inserzionisti/".$fFoto."");

        imagecopyresampled($image_p,$image,0,0,0,0,$new_width,$new_height,$width,$height);
     imagejpeg($image_p,null,100);

     move_uploaded_file($_FILES["foto"]["tmp_name"],".".$fFile);
     $sql = "UPDATE inserzionisti SET FotoUrl ='$fFoto' where Id=$id";

何か提案はありますか?

ありがとう

4

1 に答える 1