Page 1 of 1

domain - subdomain

Posted: Sat Aug 05, 2006 9:39 pm
by Circle
I got some code here from a script that allows people to host something on my domain but the broblem is that it can only be used on the domain itself at the moment while I need to use it at a subdomain (http://www.something.mysite.com) instead of (http://www.mysite.com). I hope some one can look into this couse this is the line the error warning gives me when I try to open the mainpage after a installation on a subdomain.

Don't know if you can help me out with only this part of the code if not please let me know as well so I know what I am up to.

Thanks in advance, this is the code:

Code: Select all

$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
$user_ip = encode_ip($client_ip);

Posted: Sun Aug 06, 2006 3:24 am
by volka
I hope some one can look into this couse this is the line the error warning gives me when I try to open the mainpage after a installation on a subdomain.
And the warning/error is?

Posted: Sun Aug 06, 2006 6:25 am
by Circle
This is the warning I get:

Code: Select all

Warning: include() [function.include]: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/blogvol/public_html/common.php on line 219

Warning: include(http://www.blog.mysite.com/nbs/no_forum_selected.html) [function.include]: failed to open stream: Address family not supported by protocol in /home/blogvol/public_html/common.php on line 219

Warning: include() [function.include]: Failed opening 'http://www.blog.mysite.com/nbs/no_forum_selected.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blogvol/public_html/common.php on line 219
The part I posted above is line 219 from the file common.php.

Posted: Sun Aug 06, 2006 6:56 pm
by Ambush Commander
Can you post all portions of the code that have the word "include", because the code you posted could not possibly throw that error.

Posted: Sun Aug 06, 2006 7:19 pm
by RobertGonzalez
The code you posted looks like it came straight out of phpBB. It also does nothing with the include path. It gets the users IP address, then encodes using the custom function encode_ip().

It would be helpful if we could see lines 215-220 of the file /home/blogvol/public_html/common.php.