dsdfd2322 2010-08-13 02:32
浏览 63

打开PHP页面/同时初始化会话变量?

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?

  • 写回答

1条回答 默认 最新

  • dso89762 2010-08-13 02:46
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 在matlab中Application Compiler后的软件无法打开
  • ¥15 想问一下STM32创建工程模板时遇到得问题
  • ¥15 Fiddler抓包443
  • ¥20 Qt Quick Android 项目报错及显示问题
  • ¥15 而且都没有 OpenCVConfig.cmake文件我是不是需要安装opencv,如何解决?
  • ¥15 oracleBIEE analytics
  • ¥15 H.264选择性加密例程
  • ¥50 windows的SFTP服务器如何能批量同步用户信息?
  • ¥15 centos7.9升级python3.0的问题
  • ¥15 安装CentOS6时卡住