Well, I'm making a little progress. Here is the code that I am using:
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
$handle = fopen("
http://www.xxx.com/", "r");
$im = imagecreatefromgd($handle);
header( "Content-type: image/png" );
imagepng( $im );
imagedestroy($im);
?>
When I run it, I get the following in my broswer:
Warning: imagecreatefromgd(Resource id #2) [function.imagecreatefromgd]:
failed to open stream: A file or directory in the path name does not
exist.
I thought that something was wrong with my fopen statement, but when i put
in some other code that uses it - for example, $line = fgets ($handle,
1024);
that other code works.
Why can't imagecreatefromgd find the remote file?
Larry Kleinman
Kleinman Associates, Inc.
212-949-6469
203-255-4100
TAllen@xxxxxxxxxxxx
Sent by: web400-bounces@xxxxxxxxxxxx
11/22/2010 09:45 AM
Please respond to
Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>
To
Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>
cc
Subject
Re: [WEB400] url tp image in php
Here is a link to the GD library:
www.php.net/gd
Thanks,
Todd Allen
EDPS
Electronic Data Processing Services
tallen@xxxxxxxxxxxx
Larry Kleinman
<larry@kleinmanas
soc.com> To
Sent by: Web Enabling the AS400 / iSeries
web400-bounces@mi <web400@xxxxxxxxxxxx>
drange.com cc
"web400@xxxxxxxxxxxx"
<web400@xxxxxxxxxxxx>,
2010-11-21 09:19 web400-bounces@xxxxxxxxxxxx
Subject
Re: [WEB400] url tp image in php
Please respond to
Web Enabling the
AS400 / iSeries
<web400@midrange.
com>
Thanks, everyone, for responding. Apparently I was not clear enough about
what I am trying to do. I have a PHP script that reads a lot of stuff
from a database and creates a PDF (using FPDF) which is then displayed in
a browser. Among the items that need to be included in the PDF are images
of the home pages of various other websites. Which home pages are to be
included vary from time to time, and the URLs of the ones that we want are
in the database. I want to be able to capture those home pages as
separate jpgs, put them in the IFS, then use the image method in FPDF to
include them in the PDF that I create.
Also - and forgive me, I guess I should know this - what is the GD
library, to which several people referred?
Larry Kleinman
Kleinman Associates, Inc.
212-949-6469
203-255-4100
Richard Schoen <richard@xxxxxxxxxxxxxxx>
Sent by: web400-bounces@xxxxxxxxxxxx
11/21/2010 09:07 AM
Please respond to
Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>
To
"web400@xxxxxxxxxxxx" <web400@xxxxxxxxxxxx>
cc
Subject
Re: [WEB400] url tp image in php
What kind of data do you want in the image ?
Picture, report data, electronic form, barcode...........................
Seems that you need to provide more input :-)
Regards,
Richard Schoen
RJS Software Systems Inc.
Where Information Meets Innovation
Document Management, Workflow, Report Delivery, Forms and Business
Intelligence
Email: richard@xxxxxxxxxxxxxxx
Web Site:
http://www.rjssoftware.com
Tel: (952) 736-5800
Fax: (952) 736-5801
Toll Free: (888) RJSSOFT
------------------------------
message: 4
date: Sat, 20 Nov 2010 08:14:33 -0500
from: Larry Kleinman <larry@xxxxxxxxxxxxxxxxx>
subject: [WEB400] url tp image in php
Hi all - I'm looking for a way for a PHP script to dynamically generate an
image - maybe as a jpg - for a given url. Anybody know how to do this?
Larry Kleinman
Kleinman Associates, Inc.
212-949-6469
203-255-4100
This communication and any transmitted documents are intended to be
confidential. If there is a problem with this transmission, please contact
the sender. If the reader of this message is not the intended recipient,
or the employee or agent responsible to deliver it to the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.
As an Amazon Associate we earn from qualifying purchases.