Log in

View Full Version : username and password



graf
08-13-2006, 06:16 AM
I have 2 different aplications instaled on my server,how can i bind them togader so my user doesnt have to register again ???
Basicly creat something to register a user for both aplications same time ?
is that posible ???

thetestingsite
09-02-2006, 05:47 PM
Do the apps use a database to store the registration information (ie: username, password, etc). If your registration script inserts the values into a form, just make another query to the database to install the same values to the corresponding fields for the other app. Then again, it mostly all depends on what applications they are and if they use a database or not.

AbelaJohnB
09-06-2006, 12:31 AM
graf, what are the two different aps?

graf
09-07-2006, 02:37 AM
OK they are 2 very different aplications.
1.is DragonflayCMS
2.is Dolphin

i want to connect them togather some how.

djr33
09-07-2006, 05:30 AM
I have no idea what those are. How do they work/what do they do?

thetestingsite
09-07-2006, 03:59 PM
As I have said before, if they use a database, simply make a php script that inserts the values of the registration script into both apps dbs. I have had to do that several times for some of my friends and it works perfectly.

graf
09-09-2006, 06:54 AM
yes they are using a database.
Please can you give me sample of that script which you have wroten for your friends,Can you please :)

thetestingsite
09-11-2006, 11:00 PM
all you need to do is look at the databases for each program, then make a form with the user input, then make the php script as follows:


<?
//form variables
$username = $_REQUEST[username];
$password = $_REQUEST[password];

//add or edit to fit your needs

$server = "localhost"; //server with database
$db_user = "test"; //username for database
$db_pass = "test"; //password for database
$success_url = "thankyou.html"; //url to redirect user after registration is successful.

$conn = mysql_connect($server,$db_user,$db_pass);
$adduser = mysql_db_query("program1","INSERT INTO `users`
(`id`,
`username`,
`password`)

VALUES (NULL,
'$username',
'$password')");

$adduser2 = mysql_db_query("program2","INSERT INTO `users`
(`id`,
`username`,
`password`)

VALUES (NULL,
'$username',
'$password')");

//change above to fit your needs

if ($adduser && $adduser2) {
header('Refresh: 1; url='.$success_url);

echo 'The user was created successfully! You will be redirected shortly';

} //redirect user if successful.

else {
echo 'The user was NOT created successfully! Please go <a href="javascript: history.back(1)">back</a> and try again';

} //dont redirect, but display an error message.


?>

if you need any help on this, let me know.

graf
09-13-2006, 01:19 AM
Thank you very much,I hope i can do the rest :)