I'm having a weird issue with Bootstrap. When I call for a PHP function the collapse menu doesn't work anymore.
Here is the code I'm using.
index.html header:
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="css/override.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
included before the header a config.php which has the code:
require_once(DIR_FS_INCLUDES.'functions/function.php');
$db_link = re_db_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD,DB_DATABASE);
//echo mysql_error();
define('DB_LINK', $db_link);
If I comment out the $db_link the menu start working again.
Here is the code for the $db_link
function re_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;
if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
} else {
$$link = mysql_connect($server, $username, $password);
}
if ($$link) mysql_select_db($database);
return $$link;
}
The issue with the function re_db_connect(), once again if I delete it everything works fine. I've looked at the outputted HTML and nothing seems to be out of place.
I'm not sure why PHP is effecting Bootstrap and any help would be appreciated.
Thank you in advanced.
As per PHP documentation for define
it is not recommended to use define for resources, despite being possible.
value: The value of the constant; only scalar and null values are allowed. Scalar values are integer, float, string or boolean values. It is possible to define resource constants, however it is not recommended and may cause unpredictable behavior.
Depending on your code, your line above may cause a PHP error. For this you should look at the logfiles and see if there are any errors or warnings.