weixin_33709364 2014-07-06 13:31 采纳率: 0%
浏览 8

模式登录表单

I have a webpage, where I want the ability to log in and see some user stuff. To log in, you have to click on a link, and then a jQuery modal window, is appearing. My question is now, how to I implement the login form, so the user actually can log in?

Right now, it is only input fields, without any php, since the modal is JavaScript generated.

Should I add the login-PHP on every single pages on my site, or should I add an iframe in the modal, linking to the login.php file, or should I use AJAX to send the username and password to an external site, or something else?

Some one who please can help me? :)

  • 写回答

1条回答 默认 最新

  • weixin_33701251 2014-07-06 13:46
    关注

    Use ajax, send your login info to the sever and get a code for confirmation, if the confirmation code is received, then the close modal and reload the page, here is a code snippet i used for my project once, it worked fine modify it to suite style

    <script type="text/javascript" language="JavaScript">
    
        function action(num) {
            $.ajax({
                cache: false,
                type: 'POST',
                url: 'action_reciver.php',
                data: 'confirm=' + num
    
            });
        }
    </script>
    

    this code will send info the action_receiver.php using the post request method. Use the console to debug.

    评论

报告相同问题?

悬赏问题

  • ¥200 csgo2的viewmatrix值是否还有别的获取方式
  • ¥15 Stable Diffusion,用Ebsynth utility在视频选帧图重绘,第一步报错,蒙版和帧图没法生成,怎么处理啊
  • ¥15 请把下列每一行代码完整地读懂并注释出来
  • ¥15 pycharm运行main文件,显示没有conda环境
  • ¥15 寻找公式识别开发,自动识别整页文档、图像公式的软件
  • ¥15 为什么eclipse不能再下载了?
  • ¥15 编辑cmake lists 明明写了project项目名,但是还是报错怎么回事
  • ¥15 关于#计算机视觉#的问题:求一份高质量桥梁多病害数据集
  • ¥15 特定网页无法访问,已排除网页问题
  • ¥50 如何将脑的图像投影到颅骨上