Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of automatic Registration and Login based on discuz

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces discuz automatic registration login method, the text is very detailed, has a certain reference value, interested friends must read!

This article realizes the function:

1. From the original system to enter the forum automatic login and registration

2. To achieve pop-up box on this page, do not jump

3.js initiates registration request directly when page loads

This feature was previously handled using the uc_user_register function, but today there are problems with developing user space.

project requirements

Add a forum to our existing system, but user information needs to be shared.

Implementation method: When entering the forum, bring the user information of the original system, and then register directly with the forum to get the information.

From the original system to enter the forum automatic registration login

The requested URL/template/default/images/member/bg.gif was not found on this server.

The requested URL/template/default/images/banner.png was not found on this server.

The reason for this code is that dsicuz has a lot of parameter restrictions when submitting forms, so we just keep it unchanged.

Then we need to load the page directly when the estrus request, add the following code.

The pop-up box is implemented on this page without jumping. When loading, it directly initiates a registration request.

This js code to achieve the function: when the page loads directly initiated registration request, and then return information, directly displayed in this page, rather than jump to another page

var hash = $('#hash').val(); var referer = $('#referer').val(); $.ajax({ type:'POST', url:"member.php? mod={$_G[setting][regname]}&mobile=2" +'&inajax=1', data:{ "handlekey":"registerform", "inajax" : 1, "regsubmit" :"yes", "formhash":hash, "referer" :referer }, dataType:'xml' }) .success(function(s) { popup.open(s.lastChild.firstChild.nodeValue); evalscript(s.lastChild.firstChild.nodeValue); }) .error(function() { _window.location.href = obj.attr('href'); popup.close(); });

At this time, the last step is to use what situation to transmit from the original system. This method is not provided here, I do a simulation of the data.

The requested URL/upload/source/member/member_register.php was not found on this server.

test effect

Let's create an account with ceshi123.

Test Post

Why not use uc_user_register to register users

If uc_user_register is used to register users directly, the following information will not be obtained

The above is discuz automatic registration login method to achieve all the content, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report