I have three sites and i want to use single username and password (login information) for all of these three sites. User will register on one site and that login information will use for other sites as well. How can i do that using php. Kindly help me ASAP.

you should do this by connecting the database from your main domain name that is stored your all login information. you may use the below code for connecting with database:

$host = "localhost"; //change your host here
$user = "test"; //change your username here
$pass = "password";  //change your password here
$db_name = "database"; //change your database name
 
$db = mysql_connect($host, $user, $pass); //connect to databse
mysql_select_db($db_name, $db); //select database

in $host value change here with your hosting ip address. and after that you may use the same database for every domain name.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.