optikalefx Posted January 20, 2009 Share Posted January 20, 2009 I have a bunch of mysql queries set up. They all worked fine, but i needed my info to connect to be moved above the web root so they are safe. First i set up a constants.php file that defines a bunch of constants. That works just fine. and the code to get to that file is require_once constants.php So i moved the constants file to root, which is 2 above where these are. So i changed it to require_once ../../constants.php Im able to echo the constants and get there info but mysql fails Warning: mysql_connect() [function.mysql-connect]: Access denied for user '****'@'****' (using password: YES) in /hermes/web04/b1609/pow.4ten/htdocs/paypal/newuser.php on line 66 Access denied for user '****'@'****' (using password: YES) And im not sure what cgi1204.int.bizland.net is. Im not using that anywhere. As far as i know. line 66 is just my connect query mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error()); Any idea what could be going on? Thanks guys Link to comment https://forums.phpfreaks.com/topic/141614-php-mysql-issue/ Share on other sites More sharing options...
cytech Posted January 20, 2009 Share Posted January 20, 2009 It looks like the constant for your username is coming through (just to say you might want to remove your absolute path from this post), What do you have set for SQL_SERVER Link to comment https://forums.phpfreaks.com/topic/141614-php-mysql-issue/#findComment-741243 Share on other sites More sharing options...
optikalefx Posted January 20, 2009 Author Share Posted January 20, 2009 I just have the mysql server that powweb gives me. It works when its not above the doc root. I cant figure out how to edit posts on here? Link to comment https://forums.phpfreaks.com/topic/141614-php-mysql-issue/#findComment-741257 Share on other sites More sharing options...
PFMaBiSmAd Posted January 20, 2009 Share Posted January 20, 2009 Why do you think you need to put your constants.php file outside your document root folder in order to protect it and what are you attempting to protect it from? Link to comment https://forums.phpfreaks.com/topic/141614-php-mysql-issue/#findComment-741288 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.