TianRB
TianRB

Reputation: 691

Find out the IP address of my server

i'm fairly new to PHP and MySQL (please be gentle!), and I want to connect to my server so I can make tests by using

$con=mysqli_connect("address","user","password","databaseName");

I can't for the life of me figure out the IP address to use! I'm using Filezilla for FTP and google says you can't find it from there, I also tried the backend cPanel but didn't find it anywhere. How is it done? I guess it can't be too hard... right?

Upvotes: 0

Views: 147

Answers (2)

TianRB
TianRB

Reputation: 691

Using localhost works! Thanks to everyone for the (super fast) response! Victory's $_SERVER response was also very useful!

Upvotes: 0

Victory
Victory

Reputation: 5890

$_SERVER['SERVER_ADDR'] is what you want check out all the good stuff in $_SERVER on the official site.

Upvotes: 2

Related Questions