350 ) { $strSize = redimage($locImg.$ext,350,150); } else { $strSize = ''; } $output = ''; } return $output; } function saisie_getlogo( $siren ) { require_once 'common/curl.php'; $logoUrl = $_REQUEST['logoUrl']['url']; $tabTmp = parse_url($logoUrl); $hostUrl = $tabTmp['host']; $pathUrl = $tabTmp['path']; $tmp = explode('.', basename($pathUrl)); $ext = strtolower(end($tmp)); $page = getUrl($logoUrl, '', '', '', false, $hostUrl, '', 7); $body = $page['body']; $extAuthorized = array('jpeg', 'jpg', 'png', 'gif', 'bmp'); if ( !in_array($ext, $extAuthorized ) ) { $tmp = explode('/', $page['header']['Content-Type']); $ext = trim ( str_replace('?', '',strtolower(end($tmp)) ) ); } $name_file = $siren.'.'.$ext; $fp = @fopen(PATH_LOGOS.$name_file, 'w'); @fwrite($fp, $body); @fclose($fp); }