Browse > Home / Webmaster Tutorials / How to hide css code

| Subcribe via RSS

How to hide css code

June 15th, 2009 Posted in Webmaster Tutorials

‘Rippers’ are always trying to steal your design or style? I think this will help you.

In index.php write:

<?php
  1. session_start();
  2. $_SESSION['csskey'] = "somerandomstringoftext";
  3. ?>
  1. <html>
  2. <head>
  3.         <link rel="stylesheet" type="text/css" href="style.php" />
  4.     </head>
  5.     <body>
  6.         Hello World
  7.     </body>
  8. </html>

Then, create new file called style.php
Write in it:

<?php
  1. session_start();
  2. header("Content-type: text/css"); //this will tell apatche to read file as a css format
  3.  
  4. if ($_SESSION["csskey"] != "somerandomstringoftext") {
  5. die("Protected");
  6. }
  7. $_SESSION["csskey"] = "More RandomStrIngs".rand(1,20000);
  8. ?>
  9.  
  10. /*
  11. CSS HERE
  12. */

Tutorial by litewarez

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Tags: , ,

4 Responses to “How to hide css code”

  1. Splitice Says:

    Nice idea, more of a pain to leachers than anything. If you wanted it more secure you could also use mysql to make each key unique. But anyway nice idea.

    A simple improvement could be made like this if you wanted:

    $_SESSION["csskey"] = md5($_SESSION["csskey"].”More RandomStrIngs”.rand(1,20000));

    Would make it practically impossible to breake the key atleast, but not making it impossible to leache the style still

    Splitice
    http://thewarezscene.org


  2. Litewarez Says:

    yea but think about it now splitice lol.

    MD5 has a constant string length and combining the fact that they would need the source of the file to view the unencrypted string it would not make a difference md5 or not because the md5 hash changes practically every time due to the rand(1,1000);

    but there is one flaw with this and that’s the fact the they can use a debugger to view the source of the css as its cached from the apatche buffer then brought to the clients pc and the debugger reads that.

    but none the less it will stop 100% of users that are not familiar with these tools.


  3. How I Make $300 a Day Online Says:

    Hey, great post, very well written. You should write more about this.


  4. Litewarez Says:

    Thankyou dood i will be writing as much as possible so stay tuned to the WarezTeacher for updates and more tutorials…

    P.S.

    Push that lil bookmark button please :)


Leave a Reply

You must be logged in to post a comment.