0

Good Day!

I just want to ask on how to hide the html codes of a certain page so that when my client view the source, they cant see it..


Thnak you!

4
Contributors
9
Replies
10
Views
6 Years
Discussion Span
Last Post by blocker
0

Not going to happen. If the browser can't see the mark up then the page does not get rendered. Why would you care about hiding your mark up anyways?

0

you will need to use php, or another scripting language
for example

<div id="private">
<?PHP
/*
?>
Here is the secret html!!
<?PHP
*/
?>
</div>

the /* */ comment tags in php will stop the server outputting the code to the browser

if your page is in .html format
you will need to change to a php
then add a .htaccess file:

RewriteEngine on
RewriteRule ^myfile\.html$ /myfile.php [L]

the .htaccess file redirects the url to the new page, so all links to your site will still work

Hope this helps!!

0

That is not a solution if you actually want the browser to show the content. Like I said there is not a way to keep someone from seeing the mark up of an element on a page if it is being shown in a browser.

0

If you want the code to execute and not be visible, I would suggest using a compiled Language Such as flash/actionscript, Otherwise You may simply encrypt all the code using complex javascript so it is very difficult to read, However this can create some cross-browser compatibility issues

0

thank you for the nice reply.Ive seen some sites encrypt there source code instead of hiding it. But maybe its hard to achieve it...If you have any idea pls continue posting on this topic..

Thank you!

0

Not possible. If the browser can't see it, then it can't process it. You can try to confuse your users by using ugly coding techniques, but anybody armed with FireFox and FireBug will see every element on your site.

Always remember the golden rule. If you don't want it public, don't put it online.

0

Nope. You can't hide anything from the user if you want to show it to the browser. If the browser can see it, the user can see it. You can code PHP which is hidden from the browser, but users can see everything HTML, CSS and JavaScript.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.