Web Site Adverts Coding

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Web Site Adverts Coding

    <div align='center'>hi there friends can some one help me with some coding for random adverts for a web site i am making please it would be a create help if some one could help me out please thanks very much.......... i&#39;ve tryed looking on google and can not find any thing that works i just want it so it comes up with the name of the advert and the when some one clicks on the link it takes then to a site



    sorry if this in wrong place did not now where to put this</div>

    #2
    OK this is as simple as you need it :

    replace the // PUT YOUR ADVERT CODE HERE with different advert codes

    Code:
    //chooses a random number between 0 and 4
    
    $adnumber = Rand (0,4); 
    
    //starts the random quote switch loop for selecting the advert with the random number
    
    switch ($adnumber) { 
    case 0: 
    
    // PUT YOUR ADVERT CODE HERE
    
    
    break; 
    
    case 1: 
    
    // PUT YOUR ADVERT CODE HERE
    
    break; 
    
    case 2: 
    
    // PUT YOUR ADVERT CODE HERE
    
    break; 
    
    case 3: 
    
    // PUT YOUR ADVERT CODE HERE
    
    break; 
    
    case 4: 
    
    // PUT YOUR ADVERT CODE HERE
    
    break; 
    } 
    ?>

    Comment


      #3
      <div class='quotetop'>QUOTE (wap2k @ Feb 25 2009, 04:37 AM) <{POST_SNAPBACK}></div>
      OK this is as simple as you need it :

      replace the // PUT YOUR ADVERT CODE HERE with different advert codes

      <div class='codetop'>CODE
      <div class='codemain' style='height:200px;white-space:pre;overflow:auto'>//chooses a random number between 0 and 4

      $adnumber = Rand (0,4);

      //starts the random quote switch loop for selecting the advert with the random number

      switch ($adnumber) {
      case 0:

      // PUT YOUR ADVERT CODE HERE


      break;

      case 1:

      // PUT YOUR ADVERT CODE HERE

      break;

      case 2:

      // PUT YOUR ADVERT CODE HERE

      break;

      case 3:

      // PUT YOUR ADVERT CODE HERE

      break;

      case 4:

      // PUT YOUR ADVERT CODE HERE

      break;
      }
      ?></div>[/b][/quote]



      so where its got // PUT YOUR ADVERT CODE HERE do i put the web site address there

      Comment


        #4
        yes

        Comment


          #5
          Code:
          <?php
          
          //chooses a random number between 0 and 4
          $adnumber = Rand (0,4); 
          //starts the random quote switch loop for selecting the advert with the random number
          
          switch ($adnumber) { 
          case 0: 
          
          print "<a href=\"http://www.site1.com\">http://www.site1.com</a>";
          
          break; 
          
          case 1: 
          
          print "<a href=\"http://www.site2.com\">http://www.site1.com</a>";
          
          break; 
          
          case 2: 
          
          print "<a href=\"http://www.site1.com\">http://www.site3.com</a>";
          
          break; 
          
          case 3: 
          
          print "<a href=\"http://www.site1.com\">http://www.site4.com</a>";
          
          break; 
          
          case 4: 
          
          print "<a href=\"http://www.site1.com\">http://www.site5.com</a>";
          
          break; 
          } 
          ?>

          Comment


            #6
            <div class='quotetop'>QUOTE (wap2k @ Feb 25 2009, 03:48 PM) <{POST_SNAPBACK}></div>
            <div class='codetop'>CODE
            <div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php

            //chooses a random number between 0 and 4
            $adnumber = Rand (0,4);
            //starts the random quote switch loop for selecting the advert with the random number

            switch ($adnumber) {
            case 0:

            print "<a href=\"http://www.site1.com\">http://www.site1.com</a>";

            break;

            case 1:

            print "<a href=\"http://www.site2.com\">http://www.site1.com</a>";

            break;

            case 2:

            print "<a href=\"http://www.site1.com\">http://www.site3.com</a>";

            break;

            case 3:

            print "<a href=\"http://www.site1.com\">http://www.site4.com</a>";

            break;

            case 4:

            print "<a href=\"http://www.site1.com\">http://www.site5.com</a>";

            break;
            }
            ?></div>[/b][/quote]


            can i add more links to it as well my friend

            Comment


              #7
              Yes just add a new loop and change the random number to the amount of links

              Code:
              case 5: 
              print "<a href=\"http://www.site1.com\">http://www.site6.com</a>";
              break;

              Comment


                #8
                <div class='quotetop'>QUOTE (wap2k @ Feb 25 2009, 11:11 PM) <{POST_SNAPBACK}></div>
                Yes just add a new loop and change the random number to the amount of links

                Code:
                case 5: 
                print "<a href=\"http://www.site1.com\">http://www.site6.com</a>";
                break;
                [/b]
                coding dont work on me web site

                Comment


                  #9
                  some ad sites use a file so jus use like

                  Code:
                  case 0: 
                  include(&#39;adfile1.php&#39;);
                  break;

                  Comment


                    #10
                    Originally posted by djsammy View Post
                    <div align='center'>hi there friends can some one help me with some coding for random adverts for a web site i am making please it would be a create help if some one could help me out please thanks very much.......... i&#39;ve tryed looking on google and can not find any thing that works i just want it so it comes up with the name of the advert and the when some one clicks on the link it takes then to a site



                    sorry if this in wrong place did not now where to put this</div>
                    not possible if you can't code the advertising. Close to this anyways, all I know is MobGold's GoldLink, which require you to just put the details that you used for other networks. It at least save you from coding but you must always put their code to your site.

                    Comment

                    Working...
                    X