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...
Thats on the main page where I want to include the javascript file, this is "javascript.php" below;PHP Code:<?php // <--- Happy guys?
session_start();
header("Cache-Control: no-store, no-cache");
$_SESSION["reg"] = md5("true");
?>
including the javascript.php like thisPHP 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();
?>
Live example http://members.driftpanzy.co.uk <<-- check the source out tooCode:<script src="javascript.php" type="text/javascript"></script>!
Feedback.





!
Reply With Quote