如何验证AJAX调用?AJAX

由网友(落款、我愛妳)分享简介:我设计了一个网站,该网站使用了AJAX。我有一个接受由POST方法,并存储在数据库中的数据发送一个PHP页面命名store.php。I have designed a website which uses AJAX. I have a PHP page named store.php which accepts da...

我设计了一个网站,该网站使用了AJAX。我有一个接受由POST方法,并存储在数据库中的数据发送一个PHP页面命名store.php。

I have designed a website which uses AJAX. I have a PHP page named store.php which accepts data sent by POST method and stores in the database.

我如何实现身份验证进入store.php?我只想要一个用户登录到我的网站使用store.php。

How do I implement authentication into store.php? I only want a user logged into my site to use store.php.

目前我使用htaccess的重定向为store.php的要求,但我不认为这是一个很好的解决方案。

Currently I am using htaccess to redirect the requests for store.php but I don't think that is a good solution.

推荐答案

任何AJAX调用服务器脚本仍将在请求中包含会话ID。如果要实现会议在您的网站,然后启动会话,你将能够看到会话变量为当前登录的用户。

Any AJAX Call to a Server Script will still include the session id in the request. If you are implementing sessions in your site, then start the session and you will be able to see session variables for the currently logged in user.

阅读全文

相关推荐

最新文章