domain - subdomain

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Circle
Forum Newbie
Posts: 23
Joined: Thu Jan 19, 2006 7:11 am

domain - subdomain

Post 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);
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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?
Circle
Forum Newbie
Posts: 23
Joined: Thu Jan 19, 2006 7:11 am

Post 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.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
Post Reply