Quote:
Originally Posted by T3MEDIA
umm is that safe putting that info in your index.php?
|
It's no different than putting it in a "config.php" file.
If you feel uncomfortable with it in there then put the database information in another file and then just put an include statement in the index.php file.
somefile.php:
PHP Code:
<?
$vbhost = "localhost";
$vbuser = "your_db_username";
$vbpass = "your_db_password";
$vbname = "your_db_name";
?>
index.php:
PHP Code:
<?
$userid = $HTTP_COOKIE_VARS['bbuserid'];
$password = $HTTP_COOKIE_VARS['bbpassword'];
include('somefile.php');
$vb=mysql_connect("$vbhost","$vbuser","$vbpass");
mysql_select_db($vbname,$vb) or die ("Forum Database Connectivity Error");
$vbsql=mysql_query("select * from user where userid = '$userid'");
$vbinfo=@mysql_fetch_array($vbsql);
$username=$vbinfo[username];
?>