* Thus wrote Joey ([EMAIL PROTECTED]):
> ...
>  
> if($upload_file !="")
> {
> //image size esle will ignore ...
> $img_max_width=750;
> $img_max_height=750;
> $extention=  
> $file_type1 = "image/pjpeg";

Here is your bug as you described. $extention is assigned the
value of $file_type1 after it is assigned 'image/pjpeg'.


> ...
>
> if (($upload_file_type == $file_type1) or ($upload_file_type == $file_type2)
> or ($upload_file_type == $file_type3) or ($upload_file_type == $file_type4))
> {

  There are several more elegant solutions to testing to ensure
  that the file_type is good, one of them is:

  $accept_file_types = array('image/jpeg', 'image/gif');

  if (in_array($upload_file_type, $accept_file_types) ) 
  {


> ...
>  
> $image_url="images/contacts/".$upload_file_name;
>  
> @copy($upload_file, "images/contacts/".$upload_file_name); 

see http://php.net/move_uploaded_file
about the proper way to handle uploaded files. 



> chmod("images/contacts/".$upload_file_name,0777);

0644 should be used. 777 is evil, contrary to common belief.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to