|
||||
| Register--Login--Top 20 Posters--Search Topics |
Forum Main>>Tutorials>>Showing the top domain referrals to your site. | ||
Chipmunk![]() Rank:Settler of Bobland Group: Head Administrator Posts: 2867 IP Logged PM ID and RPS ID: 1 PM [Chipmunk] View Member Photo | Last replied to on Mon Aug 16, 2010 06:03:28 Edit Post|Quote This tutorial will show you how to make a list of the top referring domains to your site. This list requires no signup from users at all, they just have to link to your site and they will show up. We will go through the basic creating the mysql tables in this tutorial and how to parse URLs into just the domain. So first we set up the mysql table, we only need one, we will call it ref_domains with the following fields: domainID - Primary,bigint, and autoincrement domainname - varchar of length 255 hitsin - bigint domainID is just an autogenerated ID that increments so there will not be two domains with the same ID domainname is the actual url of the domain hitsin is the number of hits that domain was given your site Now we go on to the code:
Lets go through it slowly. The first part:
Is just some basic connections to mySQL functions. Simply put your mysql username, password, and mysql database name where indicated. These are basic connection functions/code and can be used in any script with PHP/MYSQL. Now, the next part of the code:
This gets the referring URL and extracts the domain from it. First getenv("HTTP_REFERER") gets the referring url. The next line with explode we separate the URL into an array, based on where the "/" is. The part if the URL before the first "/" is $dom[0], between the first and second "/" is $dom[1] and so on. Next, we create a variable $domainstr and have it be an array of just the first three pieces of our domain array. Why? Because the first three pieces will always contain the domain name only. In a URL "http:" always comes before the first "/", between the first and second "/" , there is nothing so it is empty and the www.whatever.com is always between the 2nd and 3rd "/". Therefore imploding this $domainstr togehter with the "/" as the separator in the next line will always give us the full domain. Now that we've extracted the root domain from the URL, we need to determine if that domain is already in our database or if it is a new referrer and we need code to handle each case, so we need the code below:
So first we check if the referring domain is at least 5 characters, since a domain must have at least "http:" in it, it has to have at least 5 characters or it is not a valid referring domain. If it is, then we select the ID's of the records where the URL is the domain that referred us. It counts the number of rows with that URL(basically it sees if the URL is already in our table or not). If it isn't, then it does an INSERT query to insert the new URL in and give the new entry a hitsin value of 1. If it detects that the URL is already in our database(the else case), the it does an UPDATE query and increments hitsin by 1. Now the last step is to query and display the information:
This just selects all the information in the database and orders it by the number of hits sent in, in descending order. Then it throws the query into an array and loops through the array and displays a hyperlink URL to the referring domain and the number of hits the domain has sent in in table format. ----------------------------- Chipmunk, Supreme Administrator | |||||
| stafygraph Rank:acorn Group: members Posts: 1 IP Logged PM ID and RPS ID: 24175 [PM stafygraph] | Posted at Wed Sep 02, 2009 04:07:24 Edit post|Quote I need some help blocking all traffic from a particular domain referral, lets say xxx.com. I know this requires mod rewrite to first detect the referral itself and act accordingly, but don't know where to go from there. Can anyone help?The problem I'm facing is that starting recently, a sex related domain has been showing up big time in our referral logs. The referral URL itself is some strange cgi redirect script I can't make heads or tails from (redirects to a 404 page), and it's obvious they're not sending actual visitors to my site. I suspect they may simply be hot linking or accessing some non html files on our server, jacking up the referral logs in the process. Using mod rewrite would seem to be the only solution, as something like IP tables blocks the domain itself, but not traffic redirected from and not necessarily originating from the offending domain (referrals). ----------------------------- auto insurance quotes - houses for sale - home mortgage | |||||
| grow Rank:acorn Group: members Posts: 8 IP Logged PM ID and RPS ID: 26893 [PM grow] RPS score: 0 RPS challenge | Posted at Thu Feb 04, 2010 08:53:22 Edit post|Quote I am using the Showing the top domain referrals to your site script to check and monitor the main traffic of my site on daily basis. | |||||
| grow Rank:acorn Group: members Posts: 8 IP Logged PM ID and RPS ID: 26893 [PM grow] RPS score: 0 RPS challenge | Posted at Thu Feb 04, 2010 09:06:06 Edit post|Quote
| |||||
| chilpil Rank:acorn Group: members Posts: 2 IP Logged PM ID and RPS ID: 26907 [PM chilpil] RPS score: 0 RPS challenge | Posted at Fri Feb 05, 2010 05:09:20 Edit post|Quote This is a simple tutorial that shows you how to make information or images(in ase practice tests this case buttons) display in a specific number columns per row using a specific algorithem and loop.First for this example, create a table in mysql called affiliates with the follwing fields: affiliateID -primary, auto-increment, bigint URL - varchar, a+ certification practice test length 255 button - varchar length 255 URL will store the URL of the site you want to link to, and button will how the URL of the button of that site. Now you need a simple connector file like the following connect.php to connect to the database.83-640 exam | |||||
| grow Rank:acorn Group: members Posts: 8 IP Logged PM ID and RPS ID: 26893 [PM grow] RPS score: 0 RPS challenge | Posted at Fri Feb 05, 2010 10:29:16 Edit post|Quote
| |||||
| grow Rank:acorn Group: members Posts: 8 IP Logged PM ID and RPS ID: 26893 [PM grow] RPS score: 0 RPS challenge | Posted at Sat Feb 06, 2010 06:57:09 Edit post|Quote
| |||||
| grow Rank:acorn Group: members Posts: 8 IP Logged PM ID and RPS ID: 26893 [PM grow] RPS score: 0 RPS challenge | Posted at Sat Feb 06, 2010 10:51:11 Edit post|Quote I was looking for some help about API to work in my some projects and i found very useful information on this blog. sports picks | |||||
| cerse Rank:acorn Group: members Posts: 5 IP Logged PM ID and RPS ID: 27372 [PM cerse] RPS score: 0 RPS challenge | Posted at Thu Feb 25, 2010 00:12:04 Edit post|Quote This is how to paginate a long story/article by sentences. This tutorial will teach you how to split large texts into arrays, get rid of the parts not in the page, collapse the parts you want together and finally paginate the parts. So first I will show you the entire example code, this tutorial does not require any databases.a+ essentials practice test | |||||
| Anderson Rank:acorn Group: members Posts: 1 IP Logged PM ID and RPS ID: 28544 [PM Anderson] | Posted at Tue Apr 06, 2010 02:21:36 Edit post|Quote Usually with statistical compilations domain referrals mean a list of .com and. co.uk domain extensions that have hit your site i.e. you may have got; for instance! 1000 hits from a combination of .com domains, usually this is as far as it goes? Additionally; your referral list usually only extends to your last 100 referrals and these are generally just the string itself?I think that combining the two bring out a whole new ball game and perspective and is likly to get copied "So Remember Globel is the First" and have tried to demonstrate this here, Globel lists referal domains as a complete entity and below is a picture that demonstrates this, each domain as such has it's own compartment, as unique as the domain name itself, these compartments and/or domains can be anything from your own domain to a search engine domain as depicted below! ----------------------------- The homepage for the world of Gadgets For Men, Search Marketing , who specialise in new gadgets, mens gadgets and gadgets for men. | |||||
| Allen Rank:acorn Group: members Posts: 1 IP Logged PM ID and RPS ID: 30332 [PM Allen] RPS score: 0 RPS challenge | Posted at Mon Jun 21, 2010 05:10:47 Edit post|Quote Thanks regard | |||||
| alice Rank:acorn Group: members Posts: 31 IP Logged PM ID and RPS ID: 30842 [PM alice] RPS score: 0 RPS challenge | Posted at Sat Jul 10, 2010 04:24:14 Edit post|Quote I entered my first list of products I found in Albertsons in Oceanside, CA642-736. I didn't do a large shopping trip, just picked up a few things. I'm sure Albertsons has LOTS more 100% California items.642-741 I'm shopping at Sprouts in San Marcos tonight.642-746 I'll share my 100% CA's from there with you tomorrow! I love this! 642-832. | |||||
| Smith22 Rank:acorn Group: members Posts: 1 IP Logged PM ID and RPS ID: 31074 [PM Smith22] RPS score: 0 RPS challenge | Posted at Mon Jul 19, 2010 05:53:12 Edit post|Quote I love this idea and theme and have to use its interesting for me and i have to use it. its marvelous. but right now i am doing my mcse and hunt a job to establish my career, Information Technology, Software Reviews i suggest you to do the same may be your career lies in it. | |||||
| ping123 Rank:acorn Group: members Posts: 10 IP Logged PM ID and RPS ID: 31806 [PM ping123] RPS score: 0 RPS challenge | Posted at Mon Aug 16, 2010 06:03:28 Edit post|Quote Usually with statistical compilations field referrals stingy a itemize of .com and. co.uk field extensions that have impact your place i.e. you haw have got; for instance! 1000 hits from a compounding of 70-536 dumps .com domains, commonly this is as farther as it goes? Additionally; your referral itemize commonly exclusive extends to your terminal 100 referrals and these are mostly meet the progress itself? 70-536 exam I conceive that combine the digit alter discover a full newborn ball mettlesome and appearance and is likly to achieve derived "So Remember Globel is the First" and have proven to shew this here, Globel lists referal domains as a rank entity and beneath is a represent that demonstrates this, every field as much has it's possess compartment, as unequalled as the field name itself, these compartments and/or domains be able to be anything from your possess field to a see engine field as represented below 70-536 questions! | |||||
Page: 1 |