note 49766 added to function.ob-get-contents

From: Date: Tue, 08 Feb 2005 10:04:22 +0000
Subject: note 49766 added to function.ob-get-contents
Groups: php.notes 
Request: Send a blank email to php-notes+get-84653@lists.php.net to get a copy of this message
transfer image, another method (alternative to fsockopen or function socket) : server(192.168.0.1) makeimage.php ........... ........... $nameimage="xxxx.jpg" $comand=exec("plotvelocity.sh $nameimage $paramater1 $paramater2"); ob_start(); readfile($nameimage); $image_data = ob_get_contents(); ob_end_clean(); echo $image_data; unlink($nameimage); Client (192.168.0.2) $bild="images/newimage2.gif"; $host="192.168.0.1"; $url=file_get_contents("http://$host/makeimage.php?$querystring"); $fp = fopen("$bild", 'wb'); fwrite($fp, $url); fclose($fp); echo '<img src="'.$bild.'">'; naturally you can transfer whichever thing and not only images ---- Manual Page -- http://www.php.net/manual/en/function.ob-get-contents.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49766 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49766&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49766&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49766&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49766&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49766&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49766&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#84653) next »