NameSilo

Domain Display using php

Spaceship Spaceship
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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
These are just parked domains with no hosting?
 
0
•••
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
•••
yoda is correct
 
0
•••
That is what I was getting at but that wont work if the domains are not hosted but just parked instead.
 
0
•••
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
•••
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
•••
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
•••
Are you sure that in_flu_ence has cPanel, anyhow, in_flu_ence, that's right, it should work.
 
0
•••
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
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back