Hey guys.
I have a file that just has the database connection variables. If I use include to bring the file in I cannot connect to the database, but if I manualy put the variables in the file that is doing the connecting it works fine. Any idea why?
DBvars file
<?php
$Hostname = "localhost";
$Database = "test";
$Username = "test1";
$Password = "pass1";
?>
File using the vars
include("../checklogin.php");
include("../includes/successerrorclass.php");
include("../includes/dbconvars.php");//if i just use this include it doesnt work
include("../includes/dbconnectclass.php");
$con=new DBConnectClass();
$se = new SuccessErrorClass();
$nav= new NavClass();
$nav->TopNav();
$nav->SideNav();
$Submit = $_POST['Submit'];
$FullName = $_POST['txtFullName'];
$Username = $_POST['txtUsername'];
$Password = $_POST['txtPassword'];
$Email = $_POST['txtEmail'];
//If I manualy put the vars in it works fine....
$Hostname = "localhost";
$Database = "test";
$Username = "test1";
$Password = "pass1";
$con->DBConnect($Database,$Hostname,$Username,$Password);
//Insert into DB
$Insert = "INSERT INTO tblUsers (FullName,Username,Password,Email)
VALUES ('$FullName','$Username','$Password','$Email')";
$Result = mysql_query($Insert);
//close database connection
$con->DBClose();
if (!$Result){
$se->ErrorMessage("SQL, Insert error");
}else{
$se->SuccessMessage("User information succesfully added.", "../index.php", "home");
}//end if
?>