clothes store     


I need to make a web site go..

What is wrong with my web se..

Is it possible to use my mac..

Using ECommerce?

How does ECommerce work?

Domian to different website?

Can any regular joe buy a WE..

Where can I find social work..

What do pros use for website..

Can I publish iweb pages thr..

How do I get a domain name b..

How much space will I need f..

HELP!!! My email isn&#03..

HOST UNLIMITED DOMAINS!! Wha..

Need Microsoft FrontPage Gur..

I Need Help?

Dell Dual Core Intel庐 Penti..

How can I connect domain nam..

Why do IT companies rip us o..

Is it possible to host a MyS..

How do I get value from Netw..

How do I design websites for..

Paid for "more data tra..

Looking for a free web templ..

How do I access my e-mail wh..

New to Dreamweaver....and we..

How do I add a blog to my ya..

Okay, I want to make a websi..

What is the best free webhos..

Yahoo mail: does the forward..

Please help, need to host a ..

HELP!!!! Confused!?

How do you switch website ho..

Where is a place that offers..

Website related services ???

Where can I find a free webs..

Well...I'm thinking..

DNS propagation query?

How do I set up a folder?
 
PHP: code to display domain name/ip address?    [Imwebhost]

I've got a small web server set up that I use for random things. But the thing is, my IP changes randomly because the server is run from my home and the cable company changes customers' IP every so often. So every link I made is now broken as it's trying to find my old IP.

I found a small solution by using:

$_SERVER['HTTP_HOST'];

which gives me my ip address (ie: 127.0.0.1) and i simply put it into a link tag. But it's not working for my main folder, only sub folders.

ie: works for http://127.0.0.1/blog.index.php

but not for http://127.0.0.1/index.php

Is there any code that I can use that will display the domain name or ip address no matter what sub folder im in?

PHP: code to display domain name/ip address?

The full path name is returned with

$_SERVER['DOCUMENT_ROOT'];

Your current server IP is returned with

$_SERVER['SERVER_ADDR'];

PHP: code to display domain name/ip address?

If you design using relative links you wouldn't have this problem.

Anyway, try $_SERVER['SERVER_ADDR'] instead of HTTP_HOST.

PHP: code to display domain name/ip address?

http://127.0.0.1/index.php

This should work, may be some other reason. You your web server access log to see what it says when you access this main page.

PHP: code to display domain name/ip address?

$_SERVER['SERVER_ADDR'] would work for you.

It would be better to keep all links relative and include a file with the ip or dns variable in.

Have you tried dyndns? It might suit you.

https://www.dyndns.com/


[Imwebhost]


What is decent inexpensive hosting company?
Why do I often get a timed out error for Yahoo and its says ..
What are some good webhosting services?
GoDaddy.com question!?
Has anybody joined <a href="http://www.click2affilia..
Hosting a microsoft exchange server...?
I need help starting a website, what does hosting mean / do?..
Any way to get out of the 60 day lock when changing an email..
My domain name!!!!!!!!?
Can I able to run my own POP and SMTP servers ?

Google


Comment
Name: Name:  Password:   Register?
Comment:
Face  
 

links:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 email hosting 25