Page 1 of 2
Need Help
Posted: Wed Mar 17, 2004 1:00 pm
by AllenTan
Hello there,
m a Newbie in PHP.
can you help on this.
I need to protect my php pages not being cached in clinets computer.
right now my server is php 4.0.
any help will apprecited!!!
thanks
Allen
Posted: Wed Mar 17, 2004 1:09 pm
by andre_c
I've been using this:
Code: Select all
header("Expires: Mon, 14 Jul 1789 12:30:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
Maybe someone has something better but this has worked for me.
You need to do this before any output reaches the browser
Posted: Wed Mar 17, 2004 1:32 pm
by AllenTan
thanks a million!
I did apply on my page and delete my cache but when I see the page aging, it goes to cache again.
any Idea?
Rgs
Posted: Wed Mar 17, 2004 1:35 pm
by TheBentinel.com
AllenTan wrote:thanks a million!
I did apply on my page and delete my cache but when I see the page aging, it goes to cache again.
any Idea?
Rgs
Dumb question, but your browser is set to get a new version of the page every visit, right?
In IE, that's found at Tools-->Internet Options-->Settings
Posted: Wed Mar 17, 2004 1:38 pm
by AllenTan
so you are saying that applying no cache is not secure enough for my pages!? am I right?
cuz people can easyly do this: browser is set to get a new version of the page every visit
Posted: Wed Mar 17, 2004 1:41 pm
by TheBentinel.com
AllenTan wrote:so you are saying that applying no cache is not secure enough for my pages!? am I right?
cuz people can easyly do this: browser is set to get a new version of the page every visit
Well, I can't say for sure, but I think all those headers don't mean anything if the browser doesn't respect them. Maybe IE does respect them, but does Firefox? Does Dave's Custom Browser?
It's almost like trying to prevent people from viewing your HTML source, or keeping them from copying your images. You can put up roadblocks, but moderately-determined users can always drive around them.
Posted: Wed Mar 17, 2004 1:50 pm
by AllenTan
thanks and you are right!
Here it is what I am going to do.
I will have some .mov and .swf files on my php pages and wont people grab them easyly. and all these pages will have password protected. I think I should go and look for something that goes with does opjects. am I right?
any idea for this?
thanking you in advance!!!
cheers
Al
Posted: Wed Mar 17, 2004 2:08 pm
by TheBentinel.com
AllenTan wrote:I will have some .mov and .swf files on my php pages and wont people grab them easyly. and all these pages will have password protected. I think I should go and look for something that goes with does opjects. am I right?
I'm sorry, Al, I'm not following what you want to do. Do you want to show people .mov and .swf files, but prevent them from saving them to their computers?
Posted: Wed Mar 17, 2004 2:14 pm
by AllenTan
yes, exactly!
Posted: Wed Mar 17, 2004 2:19 pm
by TheBentinel.com
TheBentinel.com wrote:
I'm sorry, Al, I'm not following what you want to do. Do you want to show people .mov and .swf files, but prevent them from saving them to their computers?
See, it's impossible. The way they view your files is by downloading them to their computers. You can put one of those annoying scripts on your site that "disables" the right-click menu and I think you can even convince IE to disable the "save" option for the page. But the files are right there in their cache.
Even if you manage to get in their way, a determined user can get past it. And the first time the code you put in place manages to prevent a user from viewing your site, you've lost any advantage you've tried to gain.
Do what you like, of course. But my advice is to just host great content and not sweat the very few users that plagarize your stuff.
Posted: Wed Mar 17, 2004 2:35 pm
by AllenTan
but I have seen something like this.
there is a site for online tutorials and is based on memberships.
when I see those movies, it does not stored in my cache!
thanks a million for you time anyway!
I have to find out how they are doing.
Al
Posted: Wed Mar 17, 2004 2:39 pm
by TheBentinel.com
AllenTan wrote:
when I see those movies, it does not stored in my cache!
I went and said "impossible". You'd think I'd learn.
When you find out how they're doing it, please post it back. I don't want to do it right now, but I'd love to at least know how!
Thanks!
Posted: Wed Mar 17, 2004 2:42 pm
by AllenTan
for sure I will post when I get it!
thanks Dave for you time!
for now
Cheers
Al
Posted: Sun Mar 21, 2004 8:23 am
by AllenTan
Helle Dave,
this is the site that I was talking about.
http://www.vtc.com/products/claris.htm
when you see the movies, it does not store in your computer.
try it yourself please.
Al
Posted: Sun Mar 21, 2004 9:55 am
by d3ad1ysp0rk
Code: Select all
function openWindow(url)
{
p=url.indexOf("movie");
mtitle=url.substring(p+10,url.length);
movienum=url.substring(p+8,p+10);
chapter=url.substring(p+6,p+8);
movieURL=url.substring(url.length-9,url.length);
winwidth=640;
winheight=480+50;
wposx=0;
wposy=0;
file='http://mediaservers.vtc.com/movieplayers/movieplayer.php?size=small&foldername=cw5&title='+mtitle+'&movie='+chapter+movienum+'';
popupWin = window.open(file,"vtcplayer","status=no,resizable=no,toolbar=no,scrollbars=no,screenX="+wposx+",screenY=0,left="+wposx+",top="+wposy+",width="+winwidth+",height="+winheight);
}
Code: Select all
<img src='/images/movie.gif'> <a href="javascript:openWindow('movie=
010433045');"> Ruler Bar</a><br>
Just figure out what each thing does, and you have your filename, then create a file that links to the filename, and right click and save as.
It's impossible..