Not Solved [How To?] I want to execute a php SQL code when registration is successful
#1
Not Solved
Hi everyone. 
I'm new to mybb and for a project of mine I want to execute a php SQL code when the user is successfully registered (the registration was successful). 

I want to insert the password and the username to another database from another host, and I am not sure how to do this and what do edit. 

Can someone help me a little please?
Reply
#2
Not Solved
This will require a core edit to the PHP files of MyBB, and will be overwritten on updates so it's not recommended.

There may be a way of doing this with a plugin though. Is the database on the same server?
Reply
#3
Not Solved
a plugin can be developed for the required purpose. please see this related reply

some of the available guides for making plugins :
* plugin basics | * database methods | * plugin hooks
* guidance on plugins making
* plugins & hooks explained
* Plugin Authoring For Beginners
* How to make a plugin
* quick tutorial on plugins making
Reply
#4
Not Solved
(2018-04-06, 05:33 PM)Cybersec Wrote: This will require a core edit to the PHP files of MyBB, and will be overwritten on updates so it's not recommended.

There may be a way of doing this with a plugin though. Is the database on the same server?


Um... can't I just do something like this:
$one= mysqli_connect('localhost', 'db', 'pass', 'name');

$exec = mysqli_query($one, "INSERT --- statement");

in the "successful register" sequence?
Reply
#5
Not Solved
You can edit the php file (member.php) and search for the registration GET section (where php checks if $_GET is set and if it's set to register).

There you should be able to include the file within the function once it is successful.
This isn't recommended if you plan to upgrade your MyBB copy as it will overwrite any core edits you make.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)