I am trying to create a login script and have the following files (so far)
login.php, mysqlconnect.php, mysqlproperties, and an error logging file.
some of login.php
session_start();
include( "../database/connectionProperties/MysqlProperties.php" );
include( "../database/MysqlConnect.php" );
$mysql_prop = new MysqlProperties;
$mysql_conn = new MysqlConnect;
$mysql_conn->setProperties( $mysql_prop->getHost(), $mysql_prop->getUser, $mysql_prop->getPassword );
$mysql_conn->printProperties();
I wanted to have this in a class but it does not let me do stuff like
class login
{
var $mysql_conn = new MysqlConnect (complains about the new );
}
i have a setprop method in mysql connect as shown:
/ Set the database connection properties /
function setProperties( $mysql_host, $mysql_user, $mysql_password )
{
$this->mysql_host = $mysql_host;
$this->mysql_user = $mysql_user;
$this->_mysql_password = $mysql_password;
}
with the props taken from the mysql prop file. however it does not seem to be creating new instances of mysqlconnect or mysqlprop, as when i try to echo the variables it just appears blank, ANY help would be gratefully appreciated! Thanks in advance.