Results 1 to 4 of 4
  1. #1

    want to Show Different Ads To Different Visitors

    I got a site with imagehosting.

    now I had ads there.

    I want to do somet thing so that I can show diffrent ads to diffrent domain visitors.

    for exmaple

    doman a visitors view ads for X adnetwork

    doman b visitors view ads form y adnetwork

    etc

    if you got my point then help or I explain more

    thanks

  2. #2

    Lightbulb

    You can easily get the domain using php and show different content:

    PHP Code:
    $domain=$_SERVER['SERVER_NAME'];
    if(
    $domain=="somedomain.com"){
        echo 
    "some ads";
    }
    else{
        echo 
    "some other ads";


  3. #3
    Join Date
    Mar 2011
    Location
    Oslo, Norway
    Posts
    81
    you can use the same script above, but if you want more than just 2 you can use the following instead:
    PHP Code:
    $domain=$_SERVER['SERVER_NAME'];
    if(
    $domain=="somedomain.com"){
        echo 
    "some ads";
    }
    elseif(
    $domain=="somedomain2.com")
    {
        echo 
    "some other ads";
    }
    else{
        echo 
    "some more ads";

    just repeat the elseif block for more domains

  4. #4
    thanks guys.

    now I have a question

    I got 4 ads spot of diffrent resoulution on the site.

    If I create 4 diffrent php file for example ads1 ads2 ads3 ads4

    then I add this code in these file and for displaying this code on my header.html file. what html code I need to add.

    as in my script there are two file like header.php and header.html so for putting ads I need to put codes in html file and the html file feach some other content form the php file.

    hope you understand what I mean?

Similar Threads

  1. Replies: 9
    Last Post: 11-28-2010, 11:41 AM
  2. Showing ads of the product visitors just view on other's website?
    By mchen in forum Ecommerce Hosting & Discussion
    Replies: 0
    Last Post: 07-01-2010, 04:55 PM
  3. how can I show total number of visitors on my web site?
    By surfmanjoe in forum Dedicated Server
    Replies: 5
    Last Post: 03-27-2006, 08:47 PM
  4. AdSense Ads Send Visitors Away
    By peterinwa in forum Web Hosting Lounge
    Replies: 7
    Last Post: 04-25-2004, 11:27 AM
  5. Text ads and targeted visitors
    By geesh.net in forum Other Offers & Requests
    Replies: 4
    Last Post: 02-23-2004, 05:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •