Martin
Martin

Reputation: 2673

Secure ajax script (javascript requested PHP script)

How to make php script called by XMLHttpRequest (ajax) secure.

I mean, to not let PHP file functional by direct url, only by calling by script from my page (i don't want to show database results to not logged users, and called php script file have included database logins and functions).

I study and find unusable:

Upvotes: 1

Views: 286

Answers (1)

Fabian Schneider
Fabian Schneider

Reputation: 365

What about using randomized tokens? See best practice to generate random token for forgot password for example. You'll want to read up lots of articles on SO tho, there's much to consider when using tokens. (Especially looking at their security.)

Upvotes: 2

Related Questions