PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
That's not exactly what I was looking at doing. I wanted to make it so that the variable on page1.php was passed to page2js.php somehow... and then then javascript output was used
I was trying to get it there so that I can use it to protect the Javascript, but I got it.... to work.... I've figured out the fool proof [to me atleast] to protecting javascript files.
It's not possible to secure any scripted language, as the browser (or server) needs to read the un-obsfucated source code to run the script. What you did is make it (a little bit) tougher to get the source.
Think of it like car alarms. They won't stop your car from being stolen, but they will reduce the chances a little. Ultimately if they want your car, they will take it, nothing can stop someone who is determined enough.
Well what I did allows the browser to read the code... and as soon as it does block the user from going to the location of the javascript code... and the code isn't cached so it no were to be found. Can users really still get the code?
May I ask how? And if anyone wants to try... I posted a test here... http://tecktalkcm0391-testingphp.awards ... y_test.php
All the javascript code does it alert("PASSED"); to show that the code has been run, but I have a line that has /* the code is ... */ and if someone can find out the line, can you please let me know, cause I can't figure out how, meaning that I think the javascript might actually be "secured" to some length.
The most easy way to view JS source - FireFug plugin for FireFox
I've just spent 15 secs to view your JS source.
nickvd was right, browser has to receive valid JS, and if it does then smart man can view it without any problems
Yeah "z3nacrEsp7" was easy to pull out. Web developer plugin has "view Javascript" which will show you the Javascript for the page. Even obfuscation wouldn't be much of a barrier.
If the browser can read it so can the user without too much trouble.
The best thing you can to protect your JS source would be to obfuscate and store everything in a single monolithic function...most people would give up and just try and re-implement...
At least I would - unless you had some wicked algorithm or technique which I couldn't figure out...
Honestly though, most of what you can do in PHP or JavaScript can easily be replicated by any mediocre developer...there is little use in trying to protect such code...if it's that unique, apply for a patent - thats your best form of IP protection...