I Want To Use mysql Authentication In Custom php Script
Author: Alvin L.
Visited 419,
Followers 1,
Shared 0
I am working on custom PHP script for a website and I need to read/write data to MySQL. I know WebsiteX5 does authentication but I don't know how to use their PHP scripts to connect my script to the database. Anyone familiar with how WebsiteX5 does authentication and writes to the MySQL database, or have developer documentation for their app?
Posted on the
Hello Alvin
Although WebSite X5 does indeed allow custom codes to be inserted, some custom codes might be particularly complex and require certain knowledge of codes to be implemented correctly
Unfortunately, the Staff cannot provide support for the integration of custom codes. It is entirely up to the user to proceed to implement their code and making sure that it works within the software's infrastructure
For this reason, I'm afraid the support I can give you for this matter is very limited, I'm sorry
However, I remain available in case you have any other issues I can help you with
Thank you for your understanding
Stefano
Hey Alvin,
Many examples on the Internet are wavailable to do a DB connection and to integrate this one into PHP page into your project.
https://www.w3schools.com/php/php_mysql_connect.asp
Axel
Author
You are correct Axel. Connecting to a DB is straight forward. Detecting and using the WebsiteX5 logged in user is an issue and I needed help with making all that work.
I used this to show the name of the logged in user... so ...
<?php
$pa = Configuration::getPrivateArea();
$user = $pa->whoIsLogged();
echo "Welcome ".$user['realname'];
?>
and you can find some documentation here:
https://websitex5.readthedocs.io/en/latest/php-api/database-class.html