Is there any method using php by which I can hide my code ( HTML) from user. i.e to make it invisible on 'View Source'?
| SitePoint Sponsor |

Is there any method using php by which I can hide my code ( HTML) from user. i.e to make it invisible on 'View Source'?
Home Page| Blog | Gallery
sys op & contributor @ kn wikipedia
Still stuck with a stinky browser? Go get FireFox





You can't
This has been addressed here time and time again - it's just impossible.
-Sam
Sam Hastings

atleast my javascript... ?
Home Page| Blog | Gallery
sys op & contributor @ kn wikipedia
Still stuck with a stinky browser? Go get FireFox





Sorry, it's the same with that.Originally Posted by hpnadig
Anything that is on the internet, provided it is processed client-side (HTML, JavaScript, Flash, images etc) can be stolen or saved.
There is nothing you can do to stop people taking it.
-Sam
Sam Hastings

But you cannot decode Flash files .. can you? And aa with images.. we donot give full image. do we?
Home Page| Blog | Gallery
sys op & contributor @ kn wikipedia
Still stuck with a stinky browser? Go get FireFox





Depends...you can't always decode them...it depends whether the creator disabled it.Originally Posted by hpnadig
And although this point is true, it still doesn't stop people saving the files to their hard drive, which is what you asked originally. So it is just as easy to redistribute a Flash (SWF) file as it is to distribute an HTML page.
Sorry, I'm not sure exactly what you mean here...would you mind clarifying?And aa with images.. we donot give full image. do we?
-Sam
Sam Hastings

well, we won't be uploading the full size photo or Image, wright?Originally Posted by Devilware.net
One can sell his photo after just displaying the smaller size one..
Home Page| Blog | Gallery
sys op & contributor @ kn wikipedia
Still stuck with a stinky browser? Go get FireFox





The same old story...
You cannot simple as that; If you do not want your pages cached; People looking at your HTML / Javascript / Whatever then do not upload your pages.
Now, there is a solution for you![]()





in short: you can make it a little more or even much more difficult that others view your source
but you cannot avoid it.
We are the Borg. Resistance is futile. Prepare to be assimilated.
I'm Pentium of Borg.Division is futile.Prepare to be approximated.
HTML and javascript is the most open of open source. If you don't want it open, don't create it.





There is no point in hiding javascript / html anyways. Nothing is "all that special" and worth stealing in html..
If someone wants to take your design / code, they will take it regardless of the restrictions you put in place
Though... with a alot of overhead, and a php script, you COULD hide your javascript
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us





How would that be done...?Originally Posted by Zaire
-Sam
Sam Hastings





Originally Posted by Devilware.net
Put all your javascript in a file named .php
Put a referrer list in there, and check referrers, so if it's not a certin domain name, it can't be downloaded and viewed...
Then it's just <script language="Javascript" src="js.php"></script>
I believe that would work.. but then again not sure, didn't bother to try it... but I would think it would.
-Eric
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us





Of course, you could get around that in a second with cURL.Originally Posted by Zaire
![]()
TuitionFree — a free library for the self-taught
Anode Says... — Blogging For Your Pleasure

I've tried this before... But what do we do for preventing users from direcly accessing it? Can we chmod the file with no access to the public? Or would that mean even my page wouldn't have acces to it?Originally Posted by Zaire
Home Page| Blog | Gallery
sys op & contributor @ kn wikipedia
Still stuck with a stinky browser? Go get FireFox

Hum... it seems have no sense if any user can access http://.../js.php (trusted http_referrer) and view the javascript sourcecode anyway or I didn't understand you exactly.Originally Posted by Eric.Coleman
While it may not be completely possible, there are definite ways to keep 99% of the people out there from seeing it.
Check the source code from http://www.exocontrol.com/demo/
The average person on the net will not be able to figure that out.
(I use Opera)exoGameCtl 2.0.7i is only designed for Microsoft Internet Explorer.
We are working on a Mozilla design for v2.1!
Sorry for any inconvenence.
Riiiigghht. Hides your worthless HTML from 99% of world, yeah, because most of them can't even view you page AT ALL.
Stupid Javascript "HTML Encrypting" tools are 100% guarenteed to drive visitors away, and brands you instantly as a clueless newbie fool.
LOL most of the world uses IE but that's off subject.Originally Posted by Phil.Roberts
I never said it was the perfect solution, but it is an option for some. Just like opera isn't the perfect solution but it has it's own set of benefits so it is the choice of some. [img]images/smilies/smile.gif[/img]
Anyone who has enough technical knowledge to rip a website from it's HTML source is more than capable of defeating such pathetic tricks. So you're basically blocking access to people who would not even WANT to see the source.





IIRC a way around HTML encryption is to stick the following in your address bar:
Then you get the full, proper HTML for the pageCode:javascript:a='<pre>'%20+%20document.getElementsByTagName('html')[0].innerHTML.replace(/&/g,%20'&').replace(/</g,%20'<').replace(/>/g,%20'>').replace(/"/g,%20'"')%20+%20'</pre>';
-Sam
Sam Hastings
Looks like something I posted a while backOriginally Posted by Devilware.net
.
In any case, no, you CANNOT protect your HTML/Javascript/CSS/Images/Flash files!!
(Well flash to a certain extent, but there are flash decompilers.)
Who walks the stairs without a care
It shoots so high in the sky.
Bounce up and down just like a clown.
Everyone knows its Slinky.





Probably is, actuallyOriginally Posted by Jeff Lange
-Sam
Sam Hastings





ok, for those who are interested: Hide Your Source Code
But as i said: he who wants your code, gets it.
We are the Borg. Resistance is futile. Prepare to be assimilated.
I'm Pentium of Borg.Division is futile.Prepare to be approximated.





What about the copy of it that would be downloaded to your temporary internet files?
-Sam
Sam Hastings
Bookmarks