Re: [PHP] Loading Images from PHP broken on Redhat Enterprise
Solved! I don't believe it, there was an extra carriage return in the require file "housekeeping.php". This carriage return "is" present on Server #1, but Server #2 obviously doesn't like it. I am now going to stick my head out of my window and scream for not thinking that that could have been a possibility. Severely in need of some therapy. Thank you for all your help, Curt and Robert :) Regards, Kevin Curt Zirzow wrote: On Wed, Nov 16, 2005 at 11:44:27PM +, Kevin Smith wrote: HI Robert, I have checked both phpinfo() and php -i via the cli as follows and both produce the expected results. Also phpinfo() shows the exact same "Configure Command" data for both servers. Server #1 [EMAIL PROTECTED] limiteds_v2]# php -i | grep ini Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini Server #2 [EMAIL PROTECTED] domains]# php -i | grep ini Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini Oh and also, you really should check the output of the phpinfo() through the browser, the php cli file could be reading a different file. Also both php.ini files have PHPSESSID specifically set to only work with cookies. If this was not the case, the website wouldn't work very well, which the sites do, apart from the images on Server #2. :( PHP by default uses cookies. Curt. smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] Loading Images from PHP broken on Redhat Enterprise
Hi Curt, In that case, what on earth is going on. This is the script which is on both servers: However, I noticed that if I moved the following lines to the top of the script: header("Content-Type: image/jpeg"); header("Content-Transfer-Encoding: binary"); ..and hard-code the mime type, it outputs the correct headers, apart from "Transfer-Encoding:chunked". Which seems to still screw it up. The content length is wrong (13198), it should be 13184. Looking at the RAW output of the image data, there is a difference. I noticed 3381 was output as part of the image data, yet this is not so on the Server #1, that works. Even if I fix the content-length header to what it should be, it still has some differences. It still bugs me that the data is absolutely fine in the database, as I can save the data out of it into a file and view that file as an image with no problems at all. Anything else you can think of? Thanks, Kevin require('../classes/housekeeping.php'); $db_conn = new HOUSEKEEPING; $limiteds = $db_conn->database(); require('../classes/categories.php'); if ( isset($_GET['image_id']) && isset($_GET['field_id']) && isset($_GET['mime_type']) ) { $image_info = new CATEGORY; $image_info->LINK = $limiteds; $image_info->IMAGE_ID = $_GET['image_id']; $image_info->FIELD_ID = $_GET['field_id']; $image_info->get_thumb_image(); header("Content-Type: ".$_GET['mime_type']); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".strlen($image_info->IMAGE_THUMB)); echo $image_info->IMAGE_THUMB; } elseif ( isset($_GET['image_id']) && isset($_GET['field_id']) ) { $image_info = new CATEGORY; $image_info->LINK = $limiteds; $image_info->IMAGE_ID = $_GET['image_id']; $image_info->FIELD_ID = $_GET['field_id']; $image_info->get_thumb_image(); header("Content-Type: $image_info->MIME_TYPE"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".strlen($image_info->IMAGE_THUMB)); echo $image_info->IMAGE_THUMB; } ?> Curt Zirzow wrote: On Wed, Nov 16, 2005 at 11:44:27PM +, Kevin Smith wrote: HI Robert, Server #1 (working) http://www.limiteds.com/includes/image_load.php?image_id=8522&field_id=image_full_2 Headers for this one: Content-Transfer-Encoding: binary Vary: Accept-Encoding,User-Agent Content-Encoding: gzip P3P: CP="NOI DSP COR NID CUR OUR NOR" Content-Length: 12547 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: image/jpeg Server #2 (sad and not working) http://www.limitedshop.co.uk/includes/image_load.php?image_id=8522&field_id=image_full_2 And This one: P3P: CP="NOI DSP COR NID CUR OUR NOR" Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 Something is different. Curt. smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] Loading Images from PHP broken on Redhat Enterprise
On Wed, Nov 16, 2005 at 11:44:27PM +, Kevin Smith wrote: > HI Robert, > > I have checked both phpinfo() and php -i via the cli as follows and both > produce the expected results. Also phpinfo() shows the exact same > "Configure Command" data for both servers. > > Server #1 > [EMAIL PROTECTED] limiteds_v2]# php -i | grep ini > Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini > > Server #2 > [EMAIL PROTECTED] domains]# php -i | grep ini > Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini Oh and also, you really should check the output of the phpinfo() through the browser, the php cli file could be reading a different file. > > Also both php.ini files have PHPSESSID specifically set to only work > with cookies. If this was not the case, the website wouldn't work very > well, which the sites do, apart from the images on Server #2. :( PHP by default uses cookies. Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Loading Images from PHP broken on Redhat Enterprise
On Wed, 2005-11-16 at 18:44, Kevin Smith wrote: > > Any other ideas? This is a very strange one. The headers aren't the same, specifically the second one doesn't send the type as image/jpeg. Here's the first one: - [EMAIL PROTECTED]:~/sjhdsjhdsa> wget -S "http://www.limiteds.com/includes/image_load.php?image_id=8522&field_id=image_full_2"; --19:01:33-- http://www.limiteds.com/includes/image_load.php?image_id=8522&field_id=image_full_2 => `image_load.php?image_id=8522&field_id=image_full_2' Resolving www.limiteds.com... 217.168.144.110 Connecting to www.limiteds.com[217.168.144.110]:80... connected. HTTP request sent, awaiting response... 1 HTTP/1.1 200 OK 2 Date: Thu, 17 Nov 2005 00:01:12 GMT 3 Server: Apache/2.0.55 (Unix) mod_ssl/2.0.55 OpenSSL/0.9.7a DAV/2 PHP/4.4.1 4 X-Powered-By: PHP/4.4.1 5 Content-Transfer-Encoding: binary 6 Content-Length: 13184 7 Vary: Accept-Encoding,User-Agent 8 P3P: CP="NOI DSP COR NID CUR OUR NOR" 9 Keep-Alive: timeout=15, max=100 10 Connection: Keep-Alive 11 Content-Type: image/jpeg 100%[===>] 13,18455.98K/s 19:01:33 (55.77 KB/s) - `image_load.php?image_id=8522&field_id=image_full_2' saved [13184/13184] - Here's the second one: - [EMAIL PROTECTED]:~/sjhdsjhdsa> wget -S "http://www.limitedshop.co.uk/includes/image_load.php?image_id=8522&field_id=image_full_2"; --19:01:37-- http://www.limitedshop.co.uk/includes/image_load.php?image_id=8522&field_id=image_full_2 => `image_load.php?image_id=8522&field_id=image_full_2.1' Resolving www.limitedshop.co.uk... 83.138.141.171 Connecting to www.limitedshop.co.uk[83.138.141.171]:80... connected. HTTP request sent, awaiting response... 1 HTTP/1.1 200 OK 2 Date: Thu, 17 Nov 2005 00:01:17 GMT 3 Server: Apache/2.0.55 (Unix) mod_ssl/2.0.55 OpenSSL/0.9.7a DAV/2 PHP/4.4.1 4 X-Powered-By: PHP/4.4.1 5 Vary: Accept-Encoding,User-Agent 6 P3P: CP="NOI DSP COR NID CUR OUR NOR" 7 Connection: close 8 Content-Type: text/html; charset=ISO-8859-1 [ <=> ] 13,18552.99K/s 19:01:38 (52.94 KB/s) - `image_load.php?image_id=8522&field_id=image_full_2.1' saved [13185] - -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Loading Images from PHP broken on Redhat Enterprise
On Wed, Nov 16, 2005 at 11:44:27PM +, Kevin Smith wrote: > HI Robert, > > Server #1 (working) > http://www.limiteds.com/includes/image_load.php?image_id=8522&field_id=image_full_2 > Headers for this one: Content-Transfer-Encoding: binary Vary: Accept-Encoding,User-Agent Content-Encoding: gzip P3P: CP="NOI DSP COR NID CUR OUR NOR" Content-Length: 12547 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: image/jpeg > Server #2 (sad and not working) > http://www.limitedshop.co.uk/includes/image_load.php?image_id=8522&field_id=image_full_2 And This one: P3P: CP="NOI DSP COR NID CUR OUR NOR" Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 Something is different. Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Loading Images from PHP broken on Redhat Enterprise
HI Robert, I have checked both phpinfo() and php -i via the cli as follows and both produce the expected results. Also phpinfo() shows the exact same "Configure Command" data for both servers. Server #1 [EMAIL PROTECTED] limiteds_v2]# php -i | grep ini Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini Server #2 [EMAIL PROTECTED] domains]# php -i | grep ini Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini Also both php.ini files have PHPSESSID specifically set to only work with cookies. If this was not the case, the website wouldn't work very well, which the sites do, apart from the images on Server #2. :( Any other ideas? This is a very strange one. To show you what happens, here's the site that works and the one that doesn't: Server #1 (working) http://www.limiteds.com/includes/image_load.php?image_id=8522&field_id=image_full_2 Server #2 (sad and not working) http://www.limitedshop.co.uk/includes/image_load.php?image_id=8522&field_id=image_full_2 Regards, Kevin Robert Cummings wrote: On Wed, 2005-11-16 at 18:01, Kevin Smith wrote: Has anyone come across this problem before? Also the httpd.conf and php.ini files are identical in everyway, apart from IP addresses. Did you double check in the phpinfo() output for each server that the php.ini is being loaded for where you think it's being loaded? Cheers, Rob. smime.p7s Description: S/MIME Cryptographic Signature
Re: [PHP] Loading Images from PHP broken on Redhat Enterprise
On Wed, 2005-11-16 at 18:01, Kevin Smith wrote: > > Has anyone come across this problem before? Also the httpd.conf and > php.ini files are identical in everyway, apart from IP addresses. Did you double check in the phpinfo() output for each server that the php.ini is being loaded for where you think it's being loaded? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Loading Images
Good day, Yep, this is possible all right. I use this to display my rrdtool images. Just have the php program as the target for the image, and then supply the right header. For a gif image: header("Cache-control: private, no-cache"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Past date header("Pragma: no-cache"); header("Content-type: image/gif"); Then, just output the raw data. If you gather it with a shell command, use passthru() . There isn't anything to stop the user from saving the image, although the above headers will request that the user's client not cache it. You can make it more difficult for the user by supplying a Javascript "override" function to be executed when the user uses their right-mouse button over the image. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Omland Christopher m [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 12:47 PM To: Chris Cc: [EMAIL PROTECTED] Subject: [PHP] Loading Images I don't have any code for this, but I'm hoping someone can point me in the right direction. I want to load images or navigation menus dynamically. Is it possible to build a database of images and then use php to display them? Or something along these lines. I know this must be possible, becuase I see sites that do something like this, and I cant seem to right click the image and save it. Does this make any sense? Thanks. -Chris -- 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] Loading Images
As long as preventing users to download a picture you display, my .02Eu opinion is that is is a fruitless task. A determined user will _always_ find a way to store the picture you send him. After all, you do send data to him, therefore the data can be manipulated at will:-) As far as some code to do it, see attached souce. In the attached source, modify directories as needed. Invoke with : php -q gif2function.php > test.php Then point your browser to test.php. warning: Select a dir with few images. If yopu want to know what happens when you overdo it, goto http://helios.mm.di.uoa.gr/~rouvas/giflib.php> to see what happened to me! tested only on linux. Kevin Stone wrote: > > Huh.. hmm.. maybe this is possible after all. I'll have to test that > out when I get home. If it works it could sure save me a headache or > two. > > By the way most counters/trackers that I've seen are just simple > javascripts which gather the browser information then request a tiny > image from the server with the information in the URL string. This all > goes into the server's standard log file. Then to count the hit the > server just reads the log file and parses out the values in the URL > string. But I guess it's the same basic principle. > > -Kevin > > -Original Message- > From: Justin French [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 5:24 PM > To: php > Subject: Re: [PHP] Loading Images > > U, is that correct? > > I thought (although never tried) that you could reference an image as > > or simular, in which case the headers and > everything else CAN be sent in the image tag, which is embeded in a HTML > page -- isn't that how they do counters etc etc?? > > At the moment, I'm just storing my images in my file system, and storing > the > URLs in my database (as discussed by someone else in this thread), which > works fine, as long as nobody deletes the image without deleting the URL > from the DB. > > On the topic of preventing users from saving images, the attempts are > futile, because they can also just look at your source to DL the image > from > it's URL. > > One thing I have seen work instead of disabling right-click is to have a > clear layer (DIV) above the whole page, which (for me) prevents me from > selecting text + images from below. Although I don't know how reliable > this > is. > > Justin French > - > http://indent.com.au > http://soundpimps.com > - > > on 27/03/02 10:16 AM, Kevin Stone ([EMAIL PROTECTED]) wrote: > > > It is quite easy to store images in a database and display them on the > > screen. You can find tutorials about this online (sorry I don't have > > any direct links). There are also numerous FREE scripts pre-written > > that you can integrate into your site, or use to learn how to do this > > yourself. > > > > There is a catch however... and that is you will not be able to > display > > anything else along with those images because special content headers > > must be sent to let the browser know what kind of data it's receiving. > > Is it a JPEG, GIF or PNG? If the headers are not sent, or the wrong > > headers are sent, the image will either not display or the user will > see > > endless rows of junk text spewed onto the screen (the binary data in > > ASCII form!!). > > > > So this method will only work if you want to display the images in a > > frame, one at a time, and by them selves. You won't be able to > > intermingle HTML so forget about doing dynamic menus with this method. > > > > The way these dynamic sites work is by storing the paths to each image > > in the database rather than the images themselves... so you're back to > > the file system solution. > > > > Anyway I hope this helps answer some of the questions you were having > > about this method. :) > > > > -Kevin > > > > -Original Message- > > From: Omland Christopher m [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, March 26, 2002 2:45 PM > > To: [EMAIL PROTECTED] > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] Loading Images > > > > I wasn't so much concearned about security of users grabbin pics. I am > > more trying to learn how these people load there menus dynamically and > > pics dynamically. Do you have any links to pages or code that describe > > how > > to make a link in the db to pics on my filesystem? > > Thanks. > > -Chris > > > > On Tue, 26 Mar 2002 [EMAIL PROTECTED] wrote: > > > >> At 26.03.2002 12:47, y
RE: [PHP] Loading Images
Huh.. hmm.. maybe this is possible after all. I'll have to test that out when I get home. If it works it could sure save me a headache or two. By the way most counters/trackers that I've seen are just simple javascripts which gather the browser information then request a tiny image from the server with the information in the URL string. This all goes into the server's standard log file. Then to count the hit the server just reads the log file and parses out the values in the URL string. But I guess it's the same basic principle. -Kevin -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 5:24 PM To: php Subject: Re: [PHP] Loading Images U, is that correct? I thought (although never tried) that you could reference an image as or simular, in which case the headers and everything else CAN be sent in the image tag, which is embeded in a HTML page -- isn't that how they do counters etc etc?? At the moment, I'm just storing my images in my file system, and storing the URLs in my database (as discussed by someone else in this thread), which works fine, as long as nobody deletes the image without deleting the URL from the DB. On the topic of preventing users from saving images, the attempts are futile, because they can also just look at your source to DL the image from it's URL. One thing I have seen work instead of disabling right-click is to have a clear layer (DIV) above the whole page, which (for me) prevents me from selecting text + images from below. Although I don't know how reliable this is. Justin French - http://indent.com.au http://soundpimps.com - on 27/03/02 10:16 AM, Kevin Stone ([EMAIL PROTECTED]) wrote: > It is quite easy to store images in a database and display them on the > screen. You can find tutorials about this online (sorry I don't have > any direct links). There are also numerous FREE scripts pre-written > that you can integrate into your site, or use to learn how to do this > yourself. > > There is a catch however... and that is you will not be able to display > anything else along with those images because special content headers > must be sent to let the browser know what kind of data it's receiving. > Is it a JPEG, GIF or PNG? If the headers are not sent, or the wrong > headers are sent, the image will either not display or the user will see > endless rows of junk text spewed onto the screen (the binary data in > ASCII form!!). > > So this method will only work if you want to display the images in a > frame, one at a time, and by them selves. You won't be able to > intermingle HTML so forget about doing dynamic menus with this method. > > The way these dynamic sites work is by storing the paths to each image > in the database rather than the images themselves... so you're back to > the file system solution. > > Anyway I hope this helps answer some of the questions you were having > about this method. :) > > -Kevin > > -Original Message- > From: Omland Christopher m [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 2:45 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Loading Images > > I wasn't so much concearned about security of users grabbin pics. I am > more trying to learn how these people load there menus dynamically and > pics dynamically. Do you have any links to pages or code that describe > how > to make a link in the db to pics on my filesystem? > Thanks. > -Chris > > On Tue, 26 Mar 2002 [EMAIL PROTECTED] wrote: > >> At 26.03.2002 12:47, you wrote: >>> >>> I don't have any code for this, but I'm hoping someone can point me > in the >>> right direction. I want to load images or navigation menus > dynamically. Is >>> it possible to build a database of images and then use php to display >>> them? Or something along these lines. I know this must be possible, >>> becuase I see sites that do something like this, and I cant seem to > right >>> click the image and save it. Does this make any sense? >>> Thanks. >>> -Chris >> Storing images in a db is not a good idea. instead store them >> in your filesystem an have a reference to them in your db. >> Then you can make everything ;-) >> >> Even there´s no real security for grabbing pics. If your client can > see them, >> they are on his/her machine. To prevent the right-click, you have to > use >> JavaScript, but that only works, if the user has it switched on. >> A little more secure is putting the pics in flash-movies. But I think > there are >> already programs out, which allow to extract
Re: [PHP] Loading Images
At 26.03.2002 14:44, you wrote: >I wasn't so much concearned about security of users grabbin pics. I am >more trying to learn how these people load there menus dynamically and >pics dynamically. Do you have any links to pages or code that describe how >to make a link in the db to pics on my filesystem? >Thanks. >-Chris I cannot help you with code,also it wouldn´t really help you understanding the problem but give you more problems understanding my code. I use to have a table with the following structure TABLE MENU rn // that´s an autoincrement number for indexing page // on which page the component will appear "foobar.php3" pt // path to the pic (depending of quantity of path) "../pix/" nop // the name of the pic "foo.jpg" altval // the word which will be shown in the alt tag of the pics reference "This is the foopic" link// where will the link go "newfoo.php" orm // a number to order the sf // showflag, to switch off unwanted/uncompleted pages For pathinformations, I use an includefile which is included on every page. This holds the informations about tablewidth, pathes(oops that´s correct?), sitenames and everything the Site needs on every page. Now you just make a select like select * from menu where page="$PHP_SELF" where sf=1 order by orm And make your menu. If you put the menu in an extra page (or an object) you just have to include it on every "content page" and the work is done. echo '' while($res=answer from db) { echo '' echo '' echo ' echo '' } echo '' As you said you want to make a menu, width & height of the pics are known. Otherwise you shoul check them using fuctions from the graphic library. The Browsers are faster if they know exactly what the do. Maybe this gives you some understanding how to do it. Oliver (sorry all trailing ; are missing. It´s early today) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Loading Images
U, is that correct? I thought (although never tried) that you could reference an image as or simular, in which case the headers and everything else CAN be sent in the image tag, which is embeded in a HTML page -- isn't that how they do counters etc etc?? At the moment, I'm just storing my images in my file system, and storing the URLs in my database (as discussed by someone else in this thread), which works fine, as long as nobody deletes the image without deleting the URL from the DB. On the topic of preventing users from saving images, the attempts are futile, because they can also just look at your source to DL the image from it's URL. One thing I have seen work instead of disabling right-click is to have a clear layer (DIV) above the whole page, which (for me) prevents me from selecting text + images from below. Although I don't know how reliable this is. Justin French - http://indent.com.au http://soundpimps.com - on 27/03/02 10:16 AM, Kevin Stone ([EMAIL PROTECTED]) wrote: > It is quite easy to store images in a database and display them on the > screen. You can find tutorials about this online (sorry I don't have > any direct links). There are also numerous FREE scripts pre-written > that you can integrate into your site, or use to learn how to do this > yourself. > > There is a catch however... and that is you will not be able to display > anything else along with those images because special content headers > must be sent to let the browser know what kind of data it's receiving. > Is it a JPEG, GIF or PNG? If the headers are not sent, or the wrong > headers are sent, the image will either not display or the user will see > endless rows of junk text spewed onto the screen (the binary data in > ASCII form!!). > > So this method will only work if you want to display the images in a > frame, one at a time, and by them selves. You won't be able to > intermingle HTML so forget about doing dynamic menus with this method. > > The way these dynamic sites work is by storing the paths to each image > in the database rather than the images themselves... so you're back to > the file system solution. > > Anyway I hope this helps answer some of the questions you were having > about this method. :) > > -Kevin > > -Original Message- > From: Omland Christopher m [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 2:45 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Loading Images > > I wasn't so much concearned about security of users grabbin pics. I am > more trying to learn how these people load there menus dynamically and > pics dynamically. Do you have any links to pages or code that describe > how > to make a link in the db to pics on my filesystem? > Thanks. > -Chris > > On Tue, 26 Mar 2002 [EMAIL PROTECTED] wrote: > >> At 26.03.2002 12:47, you wrote: >>> >>> I don't have any code for this, but I'm hoping someone can point me > in the >>> right direction. I want to load images or navigation menus > dynamically. Is >>> it possible to build a database of images and then use php to display >>> them? Or something along these lines. I know this must be possible, >>> becuase I see sites that do something like this, and I cant seem to > right >>> click the image and save it. Does this make any sense? >>> Thanks. >>> -Chris >> Storing images in a db is not a good idea. instead store them >> in your filesystem an have a reference to them in your db. >> Then you can make everything ;-) >> >> Even there´s no real security for grabbing pics. If your client can > see them, >> they are on his/her machine. To prevent the right-click, you have to > use >> JavaScript, but that only works, if the user has it switched on. >> A little more secure is putting the pics in flash-movies. But I think > there are >> already programs out, which allow to extract pictures and componenets. >> HTH Oliver >> >> >> -- >> 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] Loading Images
It is quite easy to store images in a database and display them on the screen. You can find tutorials about this online (sorry I don't have any direct links). There are also numerous FREE scripts pre-written that you can integrate into your site, or use to learn how to do this yourself. There is a catch however... and that is you will not be able to display anything else along with those images because special content headers must be sent to let the browser know what kind of data it's receiving. Is it a JPEG, GIF or PNG? If the headers are not sent, or the wrong headers are sent, the image will either not display or the user will see endless rows of junk text spewed onto the screen (the binary data in ASCII form!!). So this method will only work if you want to display the images in a frame, one at a time, and by them selves. You won't be able to intermingle HTML so forget about doing dynamic menus with this method. The way these dynamic sites work is by storing the paths to each image in the database rather than the images themselves... so you're back to the file system solution. Anyway I hope this helps answer some of the questions you were having about this method. :) -Kevin -Original Message- From: Omland Christopher m [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 2:45 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Loading Images I wasn't so much concearned about security of users grabbin pics. I am more trying to learn how these people load there menus dynamically and pics dynamically. Do you have any links to pages or code that describe how to make a link in the db to pics on my filesystem? Thanks. -Chris On Tue, 26 Mar 2002 [EMAIL PROTECTED] wrote: > At 26.03.2002 12:47, you wrote: > > > >I don't have any code for this, but I'm hoping someone can point me in the > >right direction. I want to load images or navigation menus dynamically. Is > >it possible to build a database of images and then use php to display > >them? Or something along these lines. I know this must be possible, > >becuase I see sites that do something like this, and I cant seem to right > >click the image and save it. Does this make any sense? > >Thanks. > >-Chris > Storing images in a db is not a good idea. instead store them > in your filesystem an have a reference to them in your db. > Then you can make everything ;-) > > Even there´s no real security for grabbing pics. If your client can see them, > they are on his/her machine. To prevent the right-click, you have to use > JavaScript, but that only works, if the user has it switched on. > A little more secure is putting the pics in flash-movies. But I think there are > already programs out, which allow to extract pictures and componenets. > HTH Oliver > > > -- > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Loading Images
I wasn't so much concearned about security of users grabbin pics. I am more trying to learn how these people load there menus dynamically and pics dynamically. Do you have any links to pages or code that describe how to make a link in the db to pics on my filesystem? Thanks. -Chris On Tue, 26 Mar 2002 [EMAIL PROTECTED] wrote: > At 26.03.2002 12:47, you wrote: > > > >I don't have any code for this, but I'm hoping someone can point me in the > >right direction. I want to load images or navigation menus dynamically. Is > >it possible to build a database of images and then use php to display > >them? Or something along these lines. I know this must be possible, > >becuase I see sites that do something like this, and I cant seem to right > >click the image and save it. Does this make any sense? > >Thanks. > >-Chris > Storing images in a db is not a good idea. instead store them > in your filesystem an have a reference to them in your db. > Then you can make everything ;-) > > Even there´s no real security for grabbing pics. If your client can see them, > they are on his/her machine. To prevent the right-click, you have to use > JavaScript, but that only works, if the user has it switched on. > A little more secure is putting the pics in flash-movies. But I think there are > already programs out, which allow to extract pictures and componenets. > HTH Oliver > > > -- > 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] Loading Images
At 26.03.2002 12:47, you wrote: > >I don't have any code for this, but I'm hoping someone can point me in the >right direction. I want to load images or navigation menus dynamically. Is >it possible to build a database of images and then use php to display >them? Or something along these lines. I know this must be possible, >becuase I see sites that do something like this, and I cant seem to right >click the image and save it. Does this make any sense? >Thanks. >-Chris Storing images in a db is not a good idea. instead store them in your filesystem an have a reference to them in your db. Then you can make everything ;-) Even there´s no real security for grabbing pics. If your client can see them, they are on his/her machine. To prevent the right-click, you have to use JavaScript, but that only works, if the user has it switched on. A little more secure is putting the pics in flash-movies. But I think there are already programs out, which allow to extract pictures and componenets. HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php