SERGEI_MAZHARA Posted January 9, 2020 Share Posted January 9, 2020 Good day to all. I am a novice JS developer. I have an HTML page with registration and authorization connected to the Mysql database. How can I add all this to the server? Thanks. Link to comment Share on other sites More sharing options...
lopatindd Posted January 9, 2020 Share Posted January 9, 2020 Yes, you can add this to the server. Note that database requests are sent from the server(node.js). 1 Link to comment Share on other sites More sharing options...
$kylar Posted January 9, 2020 Share Posted January 9, 2020 I'll give a brief explanation. Make an HTML page for your login and registration. Place these html files inside your server-files/client_packages. Inside you HTML use JavaScript to check if the input text field are not empty. If they are empty then show an error using jQuery to edit a tag using it's ID attribute. If the input text is not empty then inside the HTML use mp.trigger to invoke a function inside your client side script. In the client side script use Event.Add inside the class' constructor. When the function is called in the client-side script use RAGE.Events.CallRemote to invoke a function in your server-side script. Inside the server-side script make a RemoteFunction attribute and use this to fetch the data from the client-side script in your server-side. Inside the server-side when the data is fetched, manipulate the data however you want. Like storing it in a file or databasethen from the server-side invoke a NAPI.Clientevent.TriggerClientEvent to invoke a function in your client-side script. And inside the client-side script when you fetch the call from the server, disable the CEF that you created in the constructor of the client-side class. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now