<? $field = stripslashes($field); $field = preg_replace("/(?:file:)?w:.*([^/]+?.(?:gif|jpg|png|bmp|tiff))/im",'./files/pix/1',$field); $fp = fopen("./files/$filename",'w'); fputs($fp,$field); fclose($fp); ?>