希望有技术知识的人可以为我回答这些问题:
我以前尝试过,我被认为不能在 jQuery Ajax 调用中使用 php 类。这是真的吗,还是有办法让它发挥作用?
如果以上是不可能的,有没有办法在没有类的情况下使用受保护/私有函数和变量?同样,我相信这是不可能的,但很想被证明是错误的。
当数据通过https传递并且无论如何都被加盐和散列服务器端时,以上所有内容是否必要?
进一步的dystroy答案......
--
您可以为此使用 PHP 反射类。在 javascript 中实现 php 方法的使用非常容易。
1 . I've tried before, and I'm led to believe that php classes cannot be used in a jQuery Ajax call. Is this true, Or is there a way of making it work?
False. Many many people use PHP pages to answer ajax requests. in fact any server-side technologies able to answer an HTTP request can be used to provide AJAX content, usually in JSON or XML. Her's the first hit Google gave me : Handling JSON like a boss in PHP
2 . If the above is not possible, is there any way of using protected/private functions and variables without classes? Again, I believe this isn't possible, but would love to be proved wrong.
Not relevant as the above is possible.
3 . Is the above all even necessary, when the data is passed over https and is salted and hashed server side anyway?
I'm not sure of your exact meaning but AJAX over HTTPS provides authentication and secrecy. Provided your solution is correctly configured, which is very very rare...
You should understand that