The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Develop your own web browser that fetches html/javascript and then converts it to a proprietary format. You'd also have to write a parsing and rendering engine that works on the proprietary formatted code.
Then you would have to have people download your special web browser so that your HTML page can be viewed.
It's really not that difficult. I don't know why everybody says it is.

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

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?

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'?

Ahh, the great debate, HTML trade secrets..

As it's been said many times before, if you don't want people to view your page source don't post a website on the Internet. There are all kinds of HTML source hiding tactics none of which is 100 percent secure.

heard recently about php files being converted to executables who's code can't be read ( some kind of Zend encoder is made use of I heard )

Your PHP code would be the only code obfuscated/hidden; your HTML and Javascript would still show.

Originally Posted by hpnadig

would that solve our problems?

I have no problem with people seeing my HTML or Javascript. What's the big deal? If somebody's that flattered by my work that they'd copy it, more power to them. If they start making money behind my back and off of my reputation then I'll sue the hell out of them, but if it's just somebody who wants to learn from my stuff or set up a personal website with similar features, then steal away.

let's put it this way, if someone with malicious intentions can hack into databases of large corporations with people who's entire job is to secure data, what makes you think that there will be any way to protect plain, simple, HTML code from getting hacked by someone with the right knowledge and experience?

Develop your own web browser that fetches html/javascript and then converts it to a proprietary format. You'd also have to write a parsing and rendering engine that works on the proprietary formatted code.
Then you would have to have people download your special web browser so that your HTML page can be viewed.

No this isn't good enough since I could grab those incoming packets.
You'd better write your own binary format for webpages with a strong built-in encryption and you will still need your own webbrowser. But hey, someone could still crack your program and peek into the memory. Well, pack and encrypt your program (this should keep those novices out) and don't forget you own anti softice trick (frogice kill almost all of them).
I don't know but this is way to insecure.
Pah, you could, of course, design your own new revolutionary super-security computer with microsoft-type bugs included but someone would crack it for sure. The best way to secure your HTML would be not to write it down and not to talk about it. Then, the only thing you would need to do would be to hope that nobody develops a talent for telepathy.
Good enough for you? </sarcasm> (Yikes! You saw a piece of my code!)

You could write an xml 1.0 dtd or schema describing elements with non-html names, apply a css stylesheet to it on the browser, so that your tag called "<divider>" behaves like a "<div>" (only make the names more cryptic. Then absolutely position a clear gif 100% wide and really long (like 2000px) high. As the user scrolls, use javascript tol reposition the gif to the top of the viewable area. This way, if someone wants to copy text they can't very easily, and copying the source would mean just copying your xml.