From: <A_L...@ti...> - 2004-04-28 18:27:35
|
Hi, I followed your suggestion but I can't login. This is showed and I don't understand why: login_Status [object Object] code - 2 description - mysql_connect(): Unknown MySQL Server Host 'HOSTNAME' (11001) details - c:\programmi\apache group\apache\htdocs\scuola2\e-speaking\my_services\services\UserHandling.php level - Warning line - 25 unshift - function () { for (var i = this.length; i > 0; i--) { this[i + arguments.length - 1] = this[i - 1]; } for (var j = 0; j < arguments.length; j++) { this[j] = arguments[j]; } this.length += arguments.length; return this.length; } registerClass - function (a, b) { application.registerClass(a, b); } It appear to scramble the constant name with this value. It's possible? Thank you. ----- Original Message ----- From: "Jorge Solis" <sol...@ho...> To: <amf...@li...> Sent: Tuesday, April 27, 2004 8:30 AM Subject: [amfphp] RE: Including config.php in services class > Just include your file at the beginning of the class as constants > > include_once("inc_sql.php"); > class UserHandling { > var $dbhost = HOSTNAME; > var $dbname = DATABASE; > var $dbuser = USERNAME; > var $dbpass = PASSWORD; > function UserHandling () > { .... > > and in inc_sql.php > > define ("USERNAME","root"); > define ("PASSWORD",""); > define ("HOSTNAME","localhost"); > define ("DATABASE","mydb"); > > Jorge > > > --__--__-- > > > > Message: 3 > > From: <A_L...@ti...> > > To: <amf...@li...> > > Date: Mon, 26 Apr 2004 22:54:39 +0200 > > Subject: [amfphp] Including config.php in services class. > > Reply-To: amf...@li... > > > > Hi all. > > I'm using amfphp without problem to handle my users validation with a > mysql > > database. > > > > This is an extract. > > <?php > > class UserHandling { > > var $dbhost='localhost'; > > var $dbname='name'; > > var $dbuser='myuser'; > > var $dbpass='mydatabase'; > > function UserHandling() { > > $this->methodTable = array( > > "login" => array( > > "description" => "Test e procedure di login", > > "access" => "remote", > > "arguments" => array("username","password","discussionename","stato") > > ), > > "logout" => array( > > "description" => "Procedura di logout", > > "access" => "remote", > > "arguments" => array("username","discussionename","role") > > ) > > ); > > $this->conn = mysql_connect($this->dbhost, $this->dbuser, > $this->dbpass); > > mysql_select_db ($this->dbname); > > } > > function login($username,$password,$discussionename,$stato) { > > ... > > } > > function logout($username,$discussionename,$role) { > > ... > > } > > ?> > > > > I'm using 4 or 5 services handler accessing mysql database so I would like > > to avoid to rewrite username,password etc in every file. > > I would like to "include" a configuration file in my php class file. > > I already have a config.php file (for other reasons) and this is an > extract: > > <? > > $url_home = '...'; > > $url_flash = '...'; > > $dbhost = 'localhost'; > > $dbusername = '...'; > > $dbpasswd = '...'; > > $database_name = '...'; > > ?> > > > > How can I use this configuration file in all my amfphp services. > > > > Thank you in advance, > > Alessandro > > > > > > > > > > --__--__-- > > > > _______________________________________________ > > amfphp-general mailing list > > amf...@li... > > https://lists.sourceforge.net/lists/listinfo/amfphp-general > > > > > > End of amfphp-general Digest > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > amfphp-general mailing list > amf...@li... > https://lists.sourceforge.net/lists/listinfo/amfphp-general |