Code: Select all
<?php
// init_db.php
$db_database = "myDatabase";
/**********************
Describe the function genericConnect
**********************/
function genericConnect($db_database){
$db_host = "localhost";
$db_user = "genericLogin";
$db_password = "uncrackable";
$db_connection = mysql_connect($db_host, $db_user, $db_password);
mysql_select_db($db_database);
return $db_connection;
} // end genericConnect
?>If the login is a valid one, I assign session variables(Session_start is called at the top of the script):
$_SESSION['username'] = xxx;
$_SESSION['authorization'] = ...
Then I redirect my page back to itself so that it can catch the session variables and display the proper content depending on the user:
Code: Select all
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/"."index.php");Warning: Cannot modify header information - headers already sent by (output started at .../phpincludes/init_db.php:12) in .../index.php on line 71
The problem is, I can't find anything in this init_db.php that might qualify as "output". Is there another place that I should redirect my attention?
Thanks all!