In the past when I have written HTML with jQuery, in order to access specific PHP pages I have simply always done this:
user.php?Action=1&User=Adrian.....
And this would return plain text JSON, which jQuery converts into a javascript object. I have a few questions regarding this method, though.
- Is this safe? JSON is being passed back in plain text. Should it be used over HTTPS?
- How is the best way to prevent direct access to PHP? Simply checking for an active session?
- Is this whole approach ok?
Cheers, Adrian