This is the case, the server intranet address is: 192.168.28.154,php code and MySQL database are here.
Then PHP needs to link to the database, so it's written in the PHP code:
$dbhost = "192.168.28.154";
...
mysql_connect ("localhost",
...
Now, you may be the PHP code with the MySQL database to deploy to other servers, but I hope that the PHP code can not be modified, then, how to get the current deployment code in PHP server IP address?
Note: An extranet map is set up here: 58.240.33.174:20280, which can be accessed by others via this IP.
Reply to discussion (solution)
If you want to deploy an intranet server, that can not need to change, but if your database is not a LAN or a server to access the intranet, then you have to move the database to the outside network, or you will have to change the database link to the program.
If you want to deploy an intranet server, that can not need to change, but if your database is not a LAN or a server to access the intranet, then you have to move the database to the outside network, or you will have to change the database link to the program.
--------------------------------------------------------------------------------------------------------------- -----------------------------
Hello, assuming I am deploying an intranet server, for example, 192.168.28.151 instead of the original 192.168.28.154, does the code need to be changed now?
$dbhost = "192.168.28.154"; what does this mean?
Both PHP and MySQL are on the same machine.
Then connect MySQL with Locathost rather than IP
Both PHP and MySQL are on the same machine.
Then connect MySQL with Locathost rather than IP
------------------------------------------------------------------------------------
$conn = mysql_connect ("localhost",
I know it's connected to the database,
What's the use of this code?
Why is the current server address assigned directly behind $dbhost?
$dbhost = "192.168.28.154";
$dbuser = "Authpuppy";
$dbpassword = "Authpuppydev";
$dbname = "Authpuppy";
$tbname = "T_node_ad";
That's the initial configuration of the project, you don't have to use it.