]+alt="LaTeX image">/',fgets($socket),$matches) ) { $remote_filename = str_replace('&','&',$matches[1]); break; } } fclose($socket); if ( $remote_filename != '' ) { $local_directory = opendir($default_directory); $file_count = 0; while ( readdir($local_directory) ) ++$file_count; closedir($local_directory); $filename = $default_directory.'latex.'.$file_count.'.png'; $local_handle = fopen($filename,'wb'); $remote_handle = fopen('http://sciencesoft.at'.$remote_filename,'rb'); if ( !$remote_handle ) { // } else { while ( !feof($remote_handle) ) { fwrite($local_handle,fgets($remote_handle,1024)); } if ( isset($_GET['xml']) ) { header('Content-type: text/xml'); print(''.chr(13)); ?>