Re: [PHP] Displaying images
Miller, Terion wrote: I am trying to get an image to display but I get nothing if done like this: Scout Photo: If I just echo the field I do get the file name Do you get the just the file name or the full path to the image on the server? If, say, the image is at /images/jamboree/whatever.jpg but $row['ePhoto'] only produces whatever.jpg, try: Scout Photo: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying images
I am trying to get an image to display but I get nothing if done like this: Scout Photo: If I just echo the field I do get the file name -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
On Saturday 29 January 2005 13:42, Ian Johnson wrote: > My php is configured to write error messages to the http error_log and > not to display errors. OK. > In this case the error is displayed and not logged. If you're referring to this ... > > The image "http://localhost/gdtst2.php"; cannot be displayed, > > because it contains errors. ... then I'm pretty sure that is generated by your browser and not by the server. When using the image functions I always have them save to file initially, then when I know that my code is 100% correct and the saved images are viewable *then* I output them directly. > Note that there is no problem with the code from phpfreaks. It seems to > run for everyone else on their computers. In that case you're doing something different to everyone else, find out what that difference is. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
Jason Wong wrote: On Saturday 29 January 2005 10:13, Ian Johnson wrote: There is no error message in the ../httpd/error_log file. That looks like the Apache error log file, which is most likely not what you want to be looking at. You want the PHP error log, see settings in php.ini, and check phpinfo(). My php is configured to write error messages to the http error_log and not to display errors. In this case the error is displayed and not logged. Note that there is no problem with the code from phpfreaks. It seems to run for everyone else on their computers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
This does the same for png as well. No errors are generated when header () is commented out or other content-types are specified Ian Johnson On Fri, 2005-01-28 at 20:45 -0800, Richard Lynch wrote: > Ian Johnson wrote: > > I am trying to use GD to create and manipulate images but the statement: > > > > header ("Content-type: image/jpg"); > > > > generates the error message: > > > > The image "http://localhost/gdtst2.php"; cannot be displayed, > > because > > it contains errors. > > "contains errors" here means "It's not a valid JPEG" > > So comment out the header() and see if you see any error messages then. > > After it looks like it's a JPEG (starts with yoya) put the header() line > back in. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
On Saturday 29 January 2005 10:13, Ian Johnson wrote: > There is no error message in the ../httpd/error_log file. That looks like the Apache error log file, which is most likely not what you want to be looking at. You want the PHP error log, see settings in php.ini, and check phpinfo(). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP displaying images
Ian Johnson wrote: > I am trying to use GD to create and manipulate images but the statement: > > header ("Content-type: image/jpg"); > > generates the error message: > > The image "http://localhost/gdtst2.php"; cannot be displayed, > because > it contains errors. "contains errors" here means "It's not a valid JPEG" So comment out the header() and see if you see any error messages then. After it looks like it's a JPEG (starts with yoya) put the header() line back in. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP displaying images
Hello I am trying to use GD to create and manipulate images but the statement: header ("Content-type: image/jpg"); generates the error message: The image "http://localhost/gdtst2.php"; cannot be displayed, because it contains errors. There is no error message in the ../httpd/error_log file. I am using PHP 5.0.3 with GD 2.0.28. The report from phpinfo() indicates gd present and enabled. Other nongraphics content-types do not gererate errors. Code used was "First Program" from tutorial at http://www.phpfreaks.com/tutorials/105/1.php. Similar code from php manual generates the same error. I suspect the solution is simple but I'm just not seeing it! Help Ian Johnson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying images
Robert, I am fairly new to php as well, but I think I may be able to help. Unless you need to modify the images when you display them, you should be able to just use html to display them as thus: --Start Code Here /* These variables would be filled in by the information you have from your flat file */ $img_loc_filename = "032902.jpg"; $img_width = 300; $img_height = 200; $img_description = "Description Here"; echo ""; --End Code Here Or something along those line Sam I'm a newbe to php and am trying to develop a routine to display artwork on my wife's site. I want to load from a flat file information about the artwork and image file names of the pieces. Then using the image file name, I want to display the image to the browser. I've figured out how to load the data from the file, but I could only find ("PHP and MySQL Web Development", Welling & Thomson) two functions to display the images: ImageCreateFromxxx or Imagexxx. Neither one works. In fact, Dreamweaver MX doesn't even show them as valid php functions. Any suggestions would be greatly appreciated Robert -- |Sam A. Funk http://www.samafunk.com [EMAIL PROTECTED]| |Wichita, KS Guitarist (self-proclaimed)Macintosh Fanatic| |Kansas Bluegrass Associationhttp://www.kansasbluegrass.org/ | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Displaying images
I had the same problem. This is due to bad documentation I think. Just ImageCreateFromxxx to imagecreatefromxxx and DW MX will show it as a valid func AND more importantly, it will work. Let me know if this helps - Sid > -Original Message- > From: Robert Stermer-Cox [mailto:[EMAIL PROTECTED] > Sent: Saturday, February 22, 2003 10:50 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Displaying images > > Greetings, All, > > I'm a newbe to php and am trying to develop a routine to display artwork > on > my wife's site. I want to load from a flat file information about the > artwork and image file names of the pieces. Then using the image file > name, > I want to display the image to the browser. I've figured out how to load > the data from the file, but I could only find ("PHP and MySQL Web > Development", Welling & Thomson) two functions to display the images: > ImageCreateFromxxx or Imagexxx. Neither one works. In fact, Dreamweaver > MX > doesn't even show them as valid php functions. > > Any suggestions would be greatly appreciated > > Robert > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Displaying images
Robert, The image functions do indeed work, check the PHP docs for more info: http://www.php.net/manual/en/ref.image.php However, your server must have the GD libraries installed and PHP must be properly configured. The docs should be a good starting point if nothing else. ---Matt -Original Message- From: Robert Stermer-Cox [mailto:[EMAIL PROTECTED] Sent: Saturday, February 22, 2003 11:20 AM To: [EMAIL PROTECTED] Subject: [PHP] Displaying images Greetings, All, I'm a newbe to php and am trying to develop a routine to display artwork on my wife's site. I want to load from a flat file information about the artwork and image file names of the pieces. Then using the image file name, I want to display the image to the browser. I've figured out how to load the data from the file, but I could only find ("PHP and MySQL Web Development", Welling & Thomson) two functions to display the images: ImageCreateFromxxx or Imagexxx. Neither one works. In fact, Dreamweaver MX doesn't even show them as valid php functions. Any suggestions would be greatly appreciated Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying images
Greetings, All, I'm a newbe to php and am trying to develop a routine to display artwork on my wife's site. I want to load from a flat file information about the artwork and image file names of the pieces. Then using the image file name, I want to display the image to the browser. I've figured out how to load the data from the file, but I could only find ("PHP and MySQL Web Development", Welling & Thomson) two functions to display the images: ImageCreateFromxxx or Imagexxx. Neither one works. In fact, Dreamweaver MX doesn't even show them as valid php functions. Any suggestions would be greatly appreciated Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying images with php?
On Wed, 5 Jun 2002, Ragnar wrote: > no, you did not misunderstand. Thats the way im building the html code for > displaying images now, but in the manual there is a lot of image-functions. > I thought that there maybe was some better way of displaying the images.. The image functions are for building new images or for modifying existing images. If you already have them ready to go sitting in a directory, there's no point messing with anything more complicated than miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying images with php?
Thx, no, you did not misunderstand. Thats the way im building the html code for displaying images now, but in the manual there is a lot of image-functions. I thought that there maybe was some better way of displaying the images.. But... hey, if this is the way it is done i guess everything is ok ;) Thanx again!! .Ragnar "Nick Wilson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > * and then Ragnar declared > > What is the best way to display images in the browser with php? If i for > > instance have the pictures in ..\pictures\ > > print(""); > > Or did i misunderstand you? > - -- > Nick Wilson // www.explodingnet.com > > > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > > iD8DBQE8/npAHpvrrTa6L5oRApm0AJ4sQ3jB12uGe3ToxMHgsKoxffon5wCfaUOI > Yvdfm+C55uKT/JJFpfVjYeQ= > =XZLu > -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying images with php?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Ragnar declared > What is the best way to display images in the browser with php? If i for > instance have the pictures in ..\pictures\ print(""); Or did i misunderstand you? - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8/npAHpvrrTa6L5oRApm0AJ4sQ3jB12uGe3ToxMHgsKoxffon5wCfaUOI Yvdfm+C55uKT/JJFpfVjYeQ= =XZLu -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying images with php?
> What is the best way to display images in the browser with php? If i > for instance have the pictures in ..\pictures\ Youre asking the wrong question. PHP doesnt display anything in the browser... the browser does that job. What you can do is one of the following: 1. Output content headers and fpassthru the file (see fpassthru in the manual for more details)2. Output the HTML with a tag with the SRC attribute pointing to the image as usual. Others on this list will be able to provide good tutorial web pages which would do the job explaining PHP's role in displaying images in the web browser much better than I can. -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software & Systems Engineer First Creative Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying images with php?
What is the best way to display images in the browser with php? If i for instance have the pictures in ..\pictures\ ?? -Ragnar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying images in another page
On Thu, Oct 25, 2001 at 10:30:24PM +0200, Rudi Ahlers wrote: > I would like to setup a banned ad server, and I will need the images > to be displayed in standard html pages, where the users don't have > php access. Thus, they should be able to call up the image from a > normal html page, ie: src="http://www.adserv.webonline.co.za/phpads.php3?what=main";> > > Can anyone give me some tips on howto do this? And any other tips for > banner ad servers would be great as well. For tips on banner ad services, I'd simply suggest looking over phpAds and other such apps (See freshmeat.net). Displaying images in this fashion is fairly simple. In the html, as you've already provided, set the to a PHP script, possibly with a query string. Then, your phpads.php3 would be responsible for outputing the image data, along with the proper HTTP header to tell the browser that you're sending it an image. That's it. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Displaying images in another page
Hi I would like to setup a banned ad server, and I will need the images to be displayed in standard html pages, where the users don't have php access. Thus, they should be able to call up the image from a normal html page, ie: http://www.adserv.webonline.co.za/phpads.php3?what=main";> Can anyone give me some tips on howto do this? And any other tips for banner ad servers would be great as well. Regards Rudi Ahlers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]