couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: example of php request with admin login:pass@localhost
Date Wed, 25 Aug 2010 07:03:47 GMT

I'm the lead developer of the PHP-on-Couch library, that you can find on github @
. 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 :

require_once "lib/couch.php";
require_once "lib/couchClient.php";
require_once "lib/couchAdmin.php";

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

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

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



----- Mail Original -----
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:pass@localhost

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

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

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





View raw message