Domain Display using php

Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
SpaceshipSpaceship
Watch

in_flu_ence

Established Member
Impact
0
Hi,

I have an account that has a couple of parked domain. I have been trying to find out how to display on screen the different domain name from the respective domain. Sorry for the poor intro.

e.g.
abc.com
cde.com
fas.com

If someone enter site via abc.com, the screen will say: "Welcome from abc.com"
If someone enter site via cde.com, the screen will say: "Welcome from cde.com"
etc.

Is that possible?

Thanks
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
These are just parked domains with no hosting?
 
0
Close
use:

Code:
echo "Welcome to " . $_SERVER[SERVER_NAME] . "<br>";

Note that this gives the "www." in front. You can certianly use substrings to nix the "www." if you'd like.

-Bob
 
0
Close
yoda is correct
 
0
Close
That is what I was getting at but that wont work if the domains are not hosted but just parked instead.
 
0
Close
CancerDailyDotCom said:
That is what I was getting at but that wont work if the domains are not hosted but just parked instead.

He did say they were parked on his post.
 
0
Close
yup mine are parked in the same account.
I shall try that later.

In the end, I've gotten

Code:
Welcome to <?php
 echo (str_replace("www.","",$_SERVER["SERVER_NAME"] ));  
?>

Thanks anyway.

To add to more fun,
Is there a way to display the entire list of my park domain using one simple php code?
or do I have to store it in a MySQL?
 
0
Close
Hey in_flu_ence,

I don't think it's possible to find out all parked domains without knowing a bit of CPanel API. The best way would be to either just store them in your php script, or if you really wanted to (dont know why you would lol) you can add it in a .txt file or a mysql db yes :).

All the best,
Rhett.
 
0
Close
Are you sure that in_flu_ence has cPanel, anyhow, in_flu_ence, that's right, it should work.
 
0
Close
oh. he is right. I guess 90% of people out there are using Cpanel or some sort. Not really many Helm, DA panel users.

I was trying to be 'funny'. I mean you have lots of talens out there. Why can't we build something simple yet useable
so i started with having a php topic like that. Of course I am not a php expert and I am learning

I guess passing through a database is great. Any other person who can do better with just php? I think using a database like mysql is very simple. Just call the values to display.

I shall think of a next nice 'simple' task that we can use for php.
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back