I’d like to have a database connection php file that would work with both localhost and in the webserver. The idea is to use some constants if I’m on localhost and other if I’m on the webserver.
Edit: The solution of the question was to know weather I’m on localhost or not.
You can always check
$_SERVER['HTTP_HOST'].