Hello,

I'm the lead developer of the PHP-on-Couch library, that you can find on github 
@ http://github.com/dready92/PHP-on-Couch . I highly suggest you use this one 
(or any other PHP library) to talk with couch server : that way your code will 
be more maintenable and you don't have to re-code the wheel.

Admitting your CouchDB server got an administrator "admin" with pass "secret", 
the following code should help you getting started :

<?PHP
require_once "lib/couch.php";
require_once "lib/couchClient.php";
require_once "lib/couchAdmin.php";

$couch_dsn = "http://admin:sec...@localhost:5984/";;

// create a database "rasmusdb"
$client = new couchClient ($couch_dsn, "rasmusdb" );
$client->createDatabase();

// create a user "rasmus" with password "lerdorf" and set it administrator of 
database "rasmusdb"
$adm = new couchAdmin($client);
$adm->createUser("rasmus","lerdorf");
$adm->addDatabaseAdminUser("rasmus");



Regards,

Mickael


----- Mail Original -----
De: [email protected]
À: [email protected]
Envoyé: Mercredi 25 Août 2010 08h44:30 GMT +01:00 Amsterdam / Berlin / Berne / 
Rome / Stockholm / Vienne
Objet: example of php request with admin login:p...@localhost

Could someone show me how to do a php request that includes the admin 
information
like login:p...@localhost

I need to use php or something to create a new database for each user and then 
add them to _users.

There is an example in the wiki called getting started with php but it does not 
have any method
for including the login:pass?

Thanks,

Dan

 

 


Reply via email to