Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 1 of 1
  1. #1
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default Hiding Clientside Coding (Javascript)

    I'm in the middle of completing a member system using, PHP, javascript and my trusty old friend MySQL as the database.

    I've been trying to figure out the best way of hiding my javascript file from being viewed be viewed by the praying eyes of code stealer's...

    I've taken into account that yes, some people who are clever enough can check their temporary folder for the JS file, but I want to make it a little bit harder for someone to exploit it via the way I'm hiding it, so any suggestions are most appreciated.

    I've used this to hide it...

    PHP Code:
    <?php // <--- Happy guys?
    session_start();
    header("Cache-Control: no-store, no-cache"); 
    $_SESSION["reg"] = md5("true");
    ?>
    Thats on the main page where I want to include the javascript file, this is "javascript.php" below;

    PHP Code:
    <?php
    session_start
    ();
    if(
    $_SESSION["reg"] == md5("true")) {
        include_once(
    "somejava.js");
    } else {
        echo(
    "Please don't attempt to steal my javascript");
    }
    $_SESSION["reg"] = md5("false");
    session_destroy();
    ?>
    including the javascript.php like this
    Code:
    <script src="javascript.php" type="text/javascript"></script>
    Live example http://members.driftpanzy.co.uk <<-- check the source out too !

    Feedback.
    Last edited by Protege; 22-03-2008 at 05:12 PM.
    Hi, names James. I am a web developer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •