Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

stripping out the .co and leaving .uk

Status
Not open for further replies.
Joined
Jul 13, 2004
Posts
5,847
Reaction score
384
can anyone help as im stumped.

what i am trying to do is on parked domains just show the domain name and .uk, for exmaple when going to wrapz.co.uk on the page it only shows wrapz.uk.

The code i am using is this:

<?php
$domainstart = $_SERVER['HTTP_HOST'];
$domainname = str_replace("www.", "", "$domainstart");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><? echo "$domainname"; ?></title>
</head>

<body>
<div align="center"><? echo "$domainname"; ?> -
<a target="_blank" href="http://wrapz.co.uk/" style="text-decoration: none">
</body>
</html>
 
Change

PHP:
$domainstart = $_SERVER['HTTP_HOST'];
$domainname = str_replace("www.", "", "$domainstart");

to

PHP:
$domainstart = $_SERVER['HTTP_HOST'];
$remove = array("www.", ".co");
$domainname = str_replace($remove, "", $domainstart);
 
Also the link within the body tags has no closing </a> or </div> tags and wrapz.co.uk has not been replaced with $domainname. So presumably you want something like this:

<div align="center">
<a target="_blank" href="http://<? echo "$domainname"; ?>/" style="text-decoration: none"><? echo "$domainname"; ?></a></div>
 
You also need to remove quotes on echo "$domainname".

It is just echo $domainname
 
Thanks guys, really appreciate your help.
 
Status
Not open for further replies.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Members online

No members online now.

Premium Members

Latest Comments

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Systreg AcornBot:
    Systreg has left the room.
      Systreg AcornBot: Systreg has left the room.
      Top Bottom