• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image Source

Hi everyone,

I would like to hide the source urls for my images on a proofing site. I have seen it done this way before and I am not sure how to get it to work in Codeignitor:

< img src="image.php?test.jpg" />

I can't get it to work with a controller in codeignitor.

I tried:

< img src="/getimage/test.jpg" />

and this won't route it to the controller, all it get a is a broken link.
In the controller I get the path to the image, and the image and then return that value.

Any thoughts?


It could be any one of many reasons.

Does this work(?):

<img src="&lt;?php echo site_url('getimage/test.jpg');?&gt;">

Going to that URL directly in your browser should give you an error message or something.

ok. I tried that. still nothing.

How should the controller output the image? Should i just echo the location or echo the photo itself?

If i go to the URL it gives me an echo of the file location (thats what I have it doing now)


Are you trying to hide the location of the images on the server? Caus you don't want people to know your file structure? You could probably do some htaccess trickery?

Yes that is the main reason I am doing it. Also, the client requested that it be this way. I have never done it this way before.

Should the controller return the image or the location?

I tried to return the file path, and that didn't work either.

Thanks for the help.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.