网站优化

网站优化

Products

当前位置:首页 > 网站优化 >

需要使WordPress表单提交触发一个在其他站点上注册新用户的进程

GG网络技术分享 2025-03-18 16:12 74


问题描述:

My problem is:

I have a WordPress website and I want it to work so that every time somebody registers him/herself as a New User on my WordPress site, it triggers a process which takes their login credentials from my WordPress site and uses them to create a new user on a second site, using those same credentials. The second site is a process management tool and is password protected. So this process / script would have to log in to the second site using my login credentials, navigate to the new sub-user registration form and paste in the credentials and submit the form.

I have tried a couple different methods for this already, so far unsuccessful and am unsure what to do next. The second site is called Pruvan. I have checked with them and their API does not support new sub-user registration. I have also tried writing a script that would sit on the Front-End of the WordPress site, gather the new user\'s login credentials from the DOM, and then make an HTTP Post request to Pruvan\'s server API. This also did not work. I\'m not sure exactly the reason why, but I think it is because Pruvan does not support Cross-Origin Resource Sharing.

I\'m trying to find a solution for this problem. Right now I have a vague idea of using a testing framework (such as Selenium) to make a virtual user go to the Pruvan website, log in, and create the sub-user using the login credentials collected from the DOM. The issue I\'m having here is that I have no idea how to start making this work with the WordPress Back-End. I have very little experience working with WordPress or PHP and would greatly appreciate some suggestions or a roadmap / blueprint of how you would approach this problem.

Thanks.

图片转代码服务由CSDN问答提供

感谢您的意见,我们尽快改进~

功能建议

我的问题是:</ p>

我有一个WordPress网站,我想要它 工作,以便每当有人在我的WordPress网站上注册他/她自己作为新用户时,它会触发一个过程,该过程从我的WordPress网站获取他们的登录凭据并使用它们在第二个网站上创建新用户,使用相同的凭据 。 第二个站点是一个进程管理工具,受密码保护。 因此,此进程/脚本必须使用我的登录凭据登录到第二个站点,导航到新的子用户注册表单并粘贴凭据并提交表单。</ p>

I 已经尝试了几种不同的方法,到目前为止还不成功,我不确定接下来该做什么。 第二个站点叫做Pruvan。 我已与他们核对过,他们的API不支持新的子用户注册。 我还尝试编写一个脚本,该脚本位于WordPress站点的前端,从DOM收集新用户的登录凭据,然后向Pruvan的服务器API发出HTTP Post请求。 这也行不通。 我不确定原因,但我认为这是因为Pruvan不支持跨源资源共享。</ p>

我正在尝试找到解决此问题的方法。 现在我有一个模糊的想法,即使用测试框架(例如Selenium)让虚拟用户访问Pruvan网站,登录,并使用从DOM收集的登录凭据创建子用户。 我在这里遇到的问题是我不知道如何使用WordPress后端开始这项工作。 我对使用WordPress或PHP的经验很少,并且非常感谢您如何处理这个问题的一些建议或路线图/蓝图。</ p>

谢谢。</ p>

</ DIV>

网友观点:

I also believe that doing this using Selenium would not be right thing.

However, if you have not found a good solution and looking at this approach as a stop gap arrangement, here is how you can do this using Selenium:

  • You may write a simple cron job that monitors your WordPress database for user registration
  • If the cron detects a new user registration, it triggers your selenium script.

You may create a jar file or similar executable for the selenium script which can be triggered as a job with username and password as parameters. For example, if you have created a jar titled InputInPMS.jar, then you may trigger the jar using command:

InputInPMS.jar <username> <password>

Alternatively, you may use a build tool like jenkins to trigger a custom job through job link and passing username and password as parameters in the link to trigger job.

标签:

提交需求或反馈

Demand feedback