开发者

Open a PHP page/initialize Session Variables Simultaneously?

I'm pretty new to PHP and JSON/XML, but we're forging ahead.

Our project entails logging in to a webservice (which we also built) from a handheld device and then accessing our website from that device. The point is to only allow users who have logged in on the handheld device to access the webpage.

Now, I guess this doesn't only apply to handhelds, but here's the question:

We can send an HTTPRequest from the handheld device and use a PHP script to validate login info from开发者_如何转开发 a database, and then return either a 'success' or 'failure' JSON object. If the user succeeds in logging in, our webservice will be opened in a browser window.

The online application relies on Session Variables for authentication every step of the way. Is there some way we can send the HTTPRequest, receive authentication, and then somehow feed the very same page we are opening some data which it will parse into session variables?


It depends on the device. Some mobile phones (like flip phones for example) will most likely not have support for AJAX. Smartphones, on the other hand, will most likely have support for AJAX.

To make it compatible with all devices, your best bet is sticking with a standard login system that posts the variables to the same page or another page for validation. Otherwise, you will be making several different websites to work on various phones.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜