Jump to content

Recommended Posts

I need to write a script that will strip the page away from the URL, meaning, if

the website is http://www.test.com/~test/1.html, I want a page that will show just the domain name, http://www.test.com.

 

I need to have a page that will list domain names that I enter, and then list them with just the URL and possibly by Page Rank.

 

Is this possible?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/107799-need-help-with-domain-names/
Share on other sites

WOW!

Thanks, that was exactly what I was looking for.

 

Now, how would I get this to display the http:// with the domain name. From what I've found, you need to have the http:// in the domain name to check the Page Rank

 

Here is the script

$hostname = $_SERVER['SERVER_NAME']; 
$hostname = str_replace('www.', '', $hostname); 
echo $hostname;

 

Thanks in advance

I am trying to get just the domain name from a list of domains.

 

These domain names:

http://www.test.com/~test/binary/1.html

http://www.foo.com/~test/1.html

http://www.ohyeah.com/letsgo/havesome/t.html

 

To show this:

http://www.test.com

http://www.foo.com

http://www.ohyeah.com

 

Then, check those domain names Page Rank, then list them from highest to lowest.

 

Now, if I use this:

 

  include('pagerank.php');
  $names = array("domain0","domain1","domain2");
  $pr = getPageRank('$name[0]','$name[1]','$name[2]');
  echo ' PR '.$pr;

 

It obviously don't work. I need the array to be just the domains, then checked against Google's Page Rank

 

Does that make sense?

 

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.