Page 1 of 1

question about URL's in deployment

Posted: Tue Mar 24, 2009 5:54 am
by greedyisg00d
Hi I am just new to web app and I am testing my application through localhost. Therefore all my links and database codes are via localhost for example:

Code: Select all

header('location:http://localhost/login.php
mysql_connect('localhost','root','')
My question is in deploying my website online do I need to change my code above since the domain name will not be localhost anymore.

Sample codes is much appreciated. Thanks

Re: question about URL's in deployment

Posted: Tue Mar 24, 2009 9:22 am
by php_east
the links yes, the database url no, it is usually localhost relative to the server. rarely some host use a different url for mysql but i would say 99% it is localhost.

these values you want to put in a config file or some form of configuration variable where you can change easily, and not change through the entire program again.