RE: [PHP] How to protect JavaScript?

2002-01-16 Thread Bart Brinkmann

Here's a good primer on mod_rewrite:

http://www.freebsddiary.org/rewrite.php

I used it to accomplish the following...
A user hits a url of say: http://foo.com/84838

I then want to return an object out of our database who's id is 84838. A 404
handler will not help in this case. So, I chose to use mod_rewrite. Anytime
/\d+$ is requested, I use mod rewrite to redirect to a php page that fetches
the object.

Thus a request for:
http://foo.com/84838   redirects to:
http://foo.com/object?id=84838

The user does not see the redirect, their url will remain
"http://foo.com/84838";.

Check out the primer above, it's pretty straght-forward.

/bart

-Original Message-
From: Martin Thoma [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 9:47 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How to protect JavaScript?


Hi Bart,

thanx for your answer.

> This would only be true if your javascript files were parsed with php.If
> not, then php can't do anything about it of course.

This is possible, I tried it out.

> Look into mod_rewrite. I
> haven't used it in the sense that you're looking for, but I don't see why
> you couldn't.
>
> http://httpd.apache.org/docs-2.0/misc/rewriteguide.html

This is a lot of stuff... Could you give me a hint where the way leads to?

Martin



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to protect JavaScript?

2002-01-16 Thread Martin Thoma

Hi Bart,

I think it's the same problem as with php: You could only protect it, when a
HTTP_REFERRER is send (which Netscape does not do):

Description:
  Assume we have under http://www.quux-corp.de/~quux/ some pages with
inlined GIF graphics. These graphics are nice, so others directly
  incorporate them via hyperlinks to their pages. We don't like this
practice because it adds useless traffic to our server.

 Solution:
  While we cannot 100% protect the images from inclusion, we can at
least restrict the cases where the browser sends a HTTP Referer header.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to protect JavaScript?

2002-01-16 Thread Martin Thoma

Hi Bart,

thanx for your answer.

> This would only be true if your javascript files were parsed with php.If
> not, then php can't do anything about it of course.

This is possible, I tried it out.

> Look into mod_rewrite. I
> haven't used it in the sense that you're looking for, but I don't see why
> you couldn't.
>
> http://httpd.apache.org/docs-2.0/misc/rewriteguide.html

This is a lot of stuff... Could you give me a hint where the way leads to?

Martin



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to protect JavaScript?

2002-01-16 Thread Bart Brinkmann

This would only be true if your javascript files were parsed with php. If
not, then php can't do anything about it of course. Look into mod_rewrite. I
haven't used it in the sense that you're looking for, but I don't see why
you couldn't.

http://httpd.apache.org/docs-2.0/misc/rewriteguide.html


/bart

-Original Message-
From: Martin Thoma [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 9:29 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to protect JavaScript?


Hello! I want to protect a JavaScript: It should only be readable out of
the document, where it is included (with