php - accessing mysql using different server to which db connection data is located -


i'm trying include file db connection info (hostname password username).

this have far:

include ('http://site.com/config35sdf322e54353452d/wp2154654315634652132513546541564.php');  mysql_connect($hostname,$username,$password); @mysql_select_db($dbname) or die( "unable select database");  include ('../refference.php'); $select = mysql_query("select my_field $usertable ". "gdi_username = '$sponsor_gdi_id' , unique_id = '$sponsor_refference'");   while($check = mysql_fetch_array($select)) {     $sponsor_email = $check["email"];     $sponsor = $check["gdi_username"];     $sponsor_first_nme = $check["first_name"];     $sponsor_second_nme = $check["last_name"];     $sponsor_domain = $check["gdi_domain"];     $unq_id = $check["unique_id"];  }   $sponsor_name = "$sponsor_first_nme $sponsor_second_nme";  echo "$sponsor $hostname" ?> 

i error saying cant select db ("unable select database")

after investigating (with echo statement @ end of code), seems having issues including .php file on different server error code:include ('http://site.com/config35sdf322e54353452d/wp2154654315634652132513546541564.php');

any clues?

thanks

you can include php files remote server enabling allow_url_include function in php.ini file.

or can enable @ runtime adding top of script

ini_set('allow_url_include', 1);

however, can cause security issues (for instance, allows attacker include remote file, such shell)


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -