Web-Host as LocalHost?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Web-Host as LocalHost?

Postby George-Edward » 06. November 2003 19:29

Is there a way I could 'include' my webhost as a localhost?

All my scripts are using (Host) fp.enter.net, when I try to pull up the page I get:

Warning: mysql_connect(): Unknown MySQL Server Host 'fp.enter.net' (11004)

I'd like to have 'fp.enter.net' = 'localhost', so I could pull up mySQL without this type of error.

I don't want to go into each script and change it for local and then change it back before I upload it to the webserver.

I got the dbTable working in PHPmyADMIN, but can't get it access thru my scripts.

Please reply with your ideas to make this work, WITHOUT re-coding all my scripts TWICE.



Postby MAGnUm » 07. November 2003 16:45

Last edited by MAGnUm on 09. November 2003 19:55, edited 1 time in total.
~~:M A G n U m:~~
(Disclaimer: if any of this info is confusing or vague tough, its free!!)
User avatar
Posts: 151
Joined: 16. October 2003 18:08
Location: USA

I got it

Postby George-Edward » 08. November 2003 01:56

Code: Select all
IF ($HTTP_HOST == "")
$db_host = "localhost";
$db_host = "fp.enter.net";

I also put db_user and db_pw in there, then COPY / PASTE thru-out the pages.

It looks like it will keep me happy for a long time.


why not like this...?

Postby chanio » 12. November 2003 06:59

:lol: $db_host = $HTTP_HOST;
Gallactic Firewall
User avatar
Posts: 72
Joined: 18. March 2003 22:05
Location: Argentina

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 99 guests