PHP question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grannytgp
    Confirmed User
    • Aug 2002
    • 269

    #1

    PHP question

    Looking for feedback on this one... I basically send the majority of my traffic to my own custom tour, and then link the join links to the best sponsor of the week that allows direct JOIN page linking.

    So for awhile now I've been using a simple PHP page for my index, rotating between the three versions of my main tour. The very simple code for the index page has been this:

    PHP Code:
    <?php
    $rand = rand(1,3);
    include("page$rand.html");
    ?>
    And then I simply had my three tour pages named page1.html - page2.html - page3.html

    So now I'm thinking I want to start incorporating some sponsor pages directly into this rotation as well. So I'm trying to think of the best way to do it, and the one thing that comes to mind is the old invisible frames trick. Something like this:

    PHP Code:
    <HTML>
    hahahahahaha>
    <title>TEST PAGE</title>
    </head>
    
    <frameset rows="100%,*" scrolling=no border=0 frameborder=no framespacing=0>
    
    <?php
    
    // seed with microseconds
    function make_seed()
    {
       list($usec, $sec) = explode(' ', microtime());
       return (float) $sec + ((float) $usec * 100000);
    }
    srand(make_seed());
    
    $rand = array('http://www.mycustomtourURL.com','http://www.sponsorURL.com');
    shuffle($rand); $rand = $rand[0];
    
    
    print "<frame src=\"$rand\" scolling=auto border=\"0\" frameborder=\"0\">";
    
    ?>
    
    </frameset>
    </html>
    Now I've tested this out, and it does work - the page comes fully into view within the frame and looks fine. But the only question I have is -- will I have an issue when it comes to the surfer clicking the JOIN links from within the frame? I know IE's security settings might kick in, and of course I want to make sure I'm getting credit for sales generated.

    Any suggestions on this one? Or possibly suggest an alternate method of rotating among my local tour pages and outside sponsor URL's?
    No sig = good sig
  • Ash@phpFX
    Confirmed User
    • Nov 2003
    • 4292

    #2
    if it works dont change it

    Comment

    • grannytgp
      Confirmed User
      • Aug 2002
      • 269

      #3
      One addition to this one... I've also tried out the following:

      PHP Code:
      <?php 
       
      // seed with microseconds 
      function make_seed() 
      { 
         list($usec, $sec) = explode(' ', microtime()); 
         return (float) $sec + ((float) $usec * 100000); 
      } 
      srand(make_seed()); 
       
      $rand = array('http://www.google.com','http://www.yahoo.com'); 
      shuffle($rand); $rand = $rand[0]; 
      include("$rand"); 
      ?>
      Now this does work, but there are two issues with it --

      1. Images are basically hotlinked, because the page appears to be loading directly off your server.
      2. If the page is coded with local URL links like such: a href="join.html" --- then IE automatically appends your own URL to that link. So that's a no-no...

      Just wanted to pass this along to anyone that might have suggestions.
      No sig = good sig

      Comment

      • grannytgp
        Confirmed User
        • Aug 2002
        • 269

        #4
        Originally posted by asher
        if it works dont change it
        Well it works in bringing the outside domain pages into view within the frame - that much is true. But... I'm not 100% sure that when a surfer clicks the JOIN link, if he will have a problem with IE security.

        Because of course that join link is going to direct them to a secure join page. And being loaded inside of a frame will either block the cookie which tracks that sale, or just plain screw up the pending sale because of the secure page being inside of the frame.
        No sig = good sig

        Comment

        • Azathoth
          Confirmed User
          • Nov 2002
          • 217

          #5
          Never heard of array_rand function?

          - Az

          Comment

          Working...