如何保护PHP代码? [英] How to secure the php code?

查看:54
本文介绍了如何保护PHP代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在创建了一个Javascript代码,将php变量转换为javascript代码,我的问题是php变量很重要,我不希望任何人都可以看到这个变量是否有任何方法可以通过我尝试的方式做到这一点使用 obfuscator 但由于Javascript代码中的PHP代码它不起作用,让我们说这是我的代码,

I created now a Javascript Code that get the php variable into javascript code, my issue that the php variable is important and I don't want any can see this variable is there is any way to do that by the way I tried to use obfuscator but it doesn't work because of the PHP code inside the Javascript code, let's say this is my Code,

<?php
$var = "this is impotant";
?>
<script type="text/javascript">
    var javaScriptVar = "<?php echo $var; ?>";
</script>

那么,有没有办法在Javascript代码中使用PHP变量或者隐藏PHP代码的结果?

So, is there any way to use PHP variables in Javascript code or hide the result of the PHP code?

推荐答案

谁想要获得价值,就会得到它。但你可以

who wants to get the value, will get it. but you can


  • 通过ajax动态注入它们

  • 编码(base64等)值

  • 混淆代码

这篇关于如何保护PHP代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆