why when i put __get() in here
$dbLink = mysql_connect($this->newCo
i received this message
Warning: mysql_connect() [function.mysql-connect]: Access denied for user
Main Topics
Browse All TopicsPHP
how to get value of string from php
say i have
***config.txt****
sendmail.to=admin@admin.co
****configuration class****
<?php
class Configuration
{
private $items = array();
function __construct() { $this->parse(); }
function __get($id) { return $this->items[ $id ]; }
function parse()
{
$lines = file("config.txt");
//$fh = fopen( $this->configFile, 'r' );
//$config = array();
foreach ($lines as $line) {
$line = explode('=', $line, 2);
//$config[trim($line[0])] = trim($line[1]);
$this->items[trim($line[0]
}
}
}
?>
$newclass = new class();
$newclass -> sendmail.to;
the output i get is to not admin@admin.com
how can i fix this?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
hence im call the function in a class therefore i need to create an object .
example
$this->tnewclass = new class();
$this->newclass ->__get("Database.Hostname
i had try to echo $this->newclass ->__get("Database.Hostname
and i get the value i want
dont know why it cant be readed in the parameter
do i need to add trim somewhere?
first of all, check:
0. check the txt file and see if the right db name, ip are there
1. check the database is there on the right server.
2. check if that db user is there, and the password is correct
3. has the db user been granted with the rights?
4. make sure the following line gives the value you were expecting:
$dbLink = mysql_connect($this->newCo
send me the result of the checks.
Business Accounts
Answer for Membership
by: mudskipperwPosted on 2008-06-30 at 02:02:33ID: 21897628
$newclass = new Configuration(); .to");
echo $newclass->__get("sendmail