473,322 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

calling image <img src=" .php" hiding img src

FX
I wanna publish a script on my site which allows me to hide image
source.
i have rough idea abt it. i`ll point src to some php page like:
<img src="image.php">
& in tht php wat exactly shud be done so tht user doesnt come to know
the real source location of image file upon clicking its properties.
I've seen websites doing this. can somebody post the script for it?

Thanx in advance

Nov 28 '05 #1
10 31616
FX wrote:
<img src="image.php">
I've seen websites doing this. can somebody post the script for it?


http://php.net/imagejpeg

--
E. Dronkert
Nov 28 '05 #2
"FX" wrote:
I wanna publish a script on my site which allows me to hide image
source.
Just don't publish your images. Works every time.
i have rough idea abt it. i`ll point src to some php page like:
<img src="image.php">
& in tht php wat exactly shud be done so tht user doesnt come to know
the real source location of image file upon clicking its properties.
Are you posting from a mobile phone? Please turn on the predictive texting
function so we can see whole words instead of this giberish.

In answer to your question, the script at "image.php" will either have to
supply the image source itself, or redirect the user's browser to the actual
location of the image. Either way you're not hiding anything.

Think about it. How the hell is your browser supposed to display an image
without being able to see the source code of the image?
I've seen websites doing this.


No you haven't.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/

Nov 28 '05 #3
FX
come on i can bet, i`ve seen these.
<?php
header("Content-Type: image/jpeg");
imagejpeg($image,'',100); // Output to Browser
?>
when u save files it displays image.php rather than imagge.jpg
although it knows jpg src

Nov 28 '05 #4
Following on from Philip Ronan's message. . .
In answer to your question, the script at "image.php" will either have to
supply the image source itself, or redirect the user's browser to the actual
location of the image. Either way you're not hiding anything.

Think about it. How the hell is your browser supposed to display an image
without being able to see the source code of the image?

Crct.

Wht the OP mns (is hard to tell, but possibly) not shw orignl URL

Hiding hot-linking to 3rd party sites. Umm...

--
PETER FOX Not the same since the porcelain business went down the pan
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Nov 28 '05 #5
FX wrote:
come on i can bet, i`ve seen these.
<?php
header("Content-Type: image/jpeg");
imagejpeg($image,'',100); // Output to Browser
?>
when u save files it displays image.php rather than imagge.jpg
although it knows jpg src


So? All I have to do is load image.php instead of image.jpg. Nothing
hidden other than the physical location of the jpeg.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 28 '05 #6
FX wrote:
I wanna publish a script on my site which allows me to hide image
source.
i have rough idea abt it. i`ll point src to some php page like:
<img src="image.php">
& in tht php wat exactly shud be done so tht user doesnt come to know
the real source location of image file upon clicking its properties.
I've seen websites doing this. can somebody post the script for it?


Are you trying to prevent hotlinking? If so then you are better off
looking at adding lines to a .htaccess file (if using Apache). Because
linking to images through a script like this won't achieve anything
other than change the URL, people can still hotlink to it.
Nov 28 '05 #7
>I wanna publish a script on my site which allows me to hide image
source.
i have rough idea abt it. i`ll point src to some php page like:
<img src="image.php">
& in tht php wat exactly shud be done so tht user doesnt come to know
the real source location of image file upon clicking its properties.
I've seen websites doing this. can somebody post the script for it?


If you want to display an image, the browser has to have a way of
getting it. Unfortunately, this means that the browser has a way
of getting it, which you don't seem to want.

It is possible to have a PHP script return an image. This does
*NOT* hide the location of the image (from the point of view of the
browser, the script *is* an image, and it can fetch it using that
URL), but it does allow the PHP to check whether the user is logged
in and authorized to access it before sending it. A PHP page could,
for example, after checking that the user is logged in, call
header("Content-type: image/jpeg"), fopen() a .jpeg file outside
the document tree, and feed it to fpassthru() to send it on to the
browser. Don't add any text; it will mess up the image.

There is still a URL the browser can use to fetch the image: your
PHP script. But you get to check for a valid login.

Gordon L. Burditt
Nov 28 '05 #8
Nick wrote:
linking to images through a script like this won't achieve anything
other than change the URL, people can still hotlink to it.


Unless you check things like the referrer or sessionID in the script.
Obviously not 100% watertight but often enough.

--
E. Dronkert
Nov 28 '05 #9
If you do something like :

header('Content-type: image/jpeg');
header('Content-Length: ' . filesize($imgFile));
$pipe = fopen($imgFile, 'rb');
fpassthru($pipe);
fclose($pipe);

I think the location will be hidden.
But not source (the binary data).

Nov 28 '05 #10
FX
ok let me further clear my purpose. I just want to add image as <img
src="image.php"/> and when somebody copies its location (image
location) the src address displayed is image.php rather than image.jpg.
i dont want image to bre hidden. i just want tht when image is right
clicked > copy in IE, then pasted somewhere, it takes location as
image.php
Wat shud be the code inside image.php ?

Nov 30 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Gregory | last post by:
Hello, I'm trying to do the above in order to process an image and return the result to an html image control. It fails and my key suspects are either the variable that I'm passing in -...
8
by: Eric Bragas | last post by:
What is this? <img src="{$ ImagesDir}/photo.gif"> I KNOW what an HTML image tag looks like. But what do you call that in the file source? Is it like a virtual directory in IIS? It's some type...
6
by: SpaceApe | last post by:
Where does the imagedata get stored in following case? <img src="cid:image001.gif@01BF4C68.ABA6D350" When I tried to save the gif file by right clicking the picture I got it as .bmp. What...
1
by: Michael Stock | last post by:
Hi all, hopefully someone can tell me how to do this for a web server in C#: We have images in a folder you can't access over the net. So everytime we need to display an image from this folder,...
2
by: McKirahan | last post by:
If I have a Web page invoked via http://myDomain.com/What.htm that references an ASP page via the <img> tag's "src=" like this: <html> <head> <title>Page.htm</title> </head> <body> <img...
1
by: grodiz | last post by:
Hi, I'm new to this forum and quite new to php. Im running a webshop based on Joomla and Virtuemart. Im currently working on adding pictures with the payment methods and for that I'm using php. I...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.