![]() |
Addhandler Images into php or html
I know this is possible but cannot find it anywhere how to fix this. I would like to open all of my images into a php or html file using htaccess.
Following line were placed in htaccess: AddHandler headered .jpg Action headered /header/header.php Then in the header.php, I've placed: <?php $header = "header.html"; $footer = "footer.html"; $image = $_SERVER["PATH_TRANSLATED"]; readfile($header); readfile($image); readfile($footer); ?> But the above is opening images as a file. Please Help. Thanks. |
Quote:
My brain is full right this second but let me think on it for a couple. . |
You need to set the content type header for the file
|
I dont even know where to start with explaining how bad that code right there is.
|
Quote:
None of that is going to work for what you are trying to do. |
Okay, since the code above won't work. Can someone lead me in the right direction? I've been looking around for a least 5 hours now.
|
Quote:
If you're trying to keep people from stealing your images, don't put them online. Putting it into a file isn't going to help stop anyone but the most idiotic surfer. All you'll be doing is adding needless overhead to your site by requiring it to open & read and write files all the time. If your site is popular, this will increase the amount of memory being used up. This is because what you're trying to do is essentially reading all the binary data from an image into one big string. Only then will it be written to file. Second, ANY display of an image on a web page needs to be done using the <img> element. yes, it can be done with <object> if you're a masochist and want to overcome all the browser compatibility nightmares. So all a surfer has to do is find the path to the file (whether it is a PHP file or a real image file) and there he can download your file. If you think displaying it in PHP will overcome theft you're wrong. In case you've made it this far and don't care about what I've said, here ya go: PHP Code:
I skipped over the part where you get the mime type and the image size. Image size is easy to get. Getting the MIME type is more involved and hey, if you want me to write the whole thing for you, you can pay me. ;-) The code above needs to be saved as its own file. Then you call it as any other image in your HTML. |
Damn, I made it thus far but still don't know where to implement the above code. I am already protected my images buy using htaccess and only giving access to images on certain sites like this one. (Actually giving access to site gfy.com) Anywho, I just would like to open images on php instead of opening on browser. Eventually I would like to put a link above the image. If payment is what you want, so be it. So back to my original question, do I place the above code on all of my php pages?
|
Quote:
The browser is always making the call to the server, delivering the image via a php script still displays the image in the browser. What exactly are you trying to accomplish with this? It originally looked to me like you were just trying to add a header and a footer to an image (watermarking it in essence) But, now I am thoroughly confused :helpme . |
looking for something along this line.
gyrls.com/upload/show.php?image=0719.jpg |
Quote:
I don't mean that to sound negative. I just think if we had a better idea of what exactly you're trying to accomplish we might be better equipped to answer you more effectively. It looks to me like the page you've referenced above does this: Code:
<html> |
Quote:
The method he was going at it at the beginning was what confused the issue. . |
Basically this is what I need. All of my gallery images opens up in the browser like this.
silentpix.com/gallery/nsfw/planet-mandy-showing-off-huge-sexy-titties/00.jpg is there a way I can open all images to look like this... silentpix.com/image.html using htaccess so I don't have to recreate all htmls manually. Thank you in advance. |
Quote:
The <img> tag expects an image type file in return. If you return an html file to an <img> tage, the browser will not be able to display it. If you want to do what you are talking about from a thumb click than the url needs to reference a text type file (html, php, txt, whatever) to display it in the browser as html. That is all as "far as I know". . |
All times are GMT -7. The time now is 10:41 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123