0
Welcome Guest! Login
0 items Join Now

Different redirects

    • MrCodexCY's Avatar
    • MrCodexCY
    • Rocketeer
    • Posts: 73
    • Thanks: 0
    • Web Design Specialist

    Different redirects

    Posted 14 years 2 months ago
    • Hello,

      Ok i am doing a splash page for my clients that is viewed only once. The problem is that i have 2 splash pages, one for IE which is a jpg image, and one with png and fade in javascript code which is for all others browsers. The problem is that the IE redirect works great, but firefox gets redirected to the IE splash page too and can't figure out why..

      Here is the code:
          <script language="JavaScript" type = "text/javascript">
      <!--
      if (navigator.appName == "Microsoft Internet Explorer")
      {
      <?php
      $dateTime = date('Y/m/d G:i:s');
      $fp = fopen('ipcheckxpcpro.txt', 'r+');
      if(!$fp){
      echo "Log file doesn't exists.";
      }
      else{
      $visited = FALSE;
      while (!feof($fp))
      {
      $buffer = fgets($fp);
      list ($ip, $time) = split(' ', $buffer);
      //Checks if IP is already logged.
      if ($_SERVER['REMOTE_ADDR'] == trim($ip)){
      $visited = TRUE;
      }
      }
      if (!$visited){
      fwrite($fp, $_SERVER['REMOTE_ADDR']. " $dateTime\n");
      Header( "Location: http://www.domain.com/splash-ie.html" );
      }
      fclose($fp);
      }
      ?>          
      }
      else
      {
      <?php
      $dateTime = date('Y/m/d G:i:s');
      $fp = fopen('ipcheckxpcpro.txt', 'r+');
      if(!$fp){
      echo "Log file doesn't exists.";
      }
      else{
      $visited = FALSE;
      while (!feof($fp))
      {
      $buffer = fgets($fp);
      list ($ip, $time) = split(' ', $buffer);
      //Checks if IP is already logged.
      if ($_SERVER['REMOTE_ADDR'] == trim($ip)){
      $visited = TRUE;
      }
      }
      if (!$visited){
      fwrite($fp, $_SERVER['REMOTE_ADDR']. " $dateTime\n");
      Header( "Location: http://www.domain.com/splash.html" );
      }
      fclose($fp);
      }
      ?>          
      }
      //-->
      </script>

      Any ideas?
    • Even a broken clock is right twice every day.
    • Joe Halleck's Avatar
    • Joe Halleck
    • Preeminent Rocketeer
    • Posts: 5481
    • Thanks: 68
    • Never give up!

    Re: Different redirects

    Posted 14 years 2 months ago
    • Check your web log and see what browser type your firefox is seen as from the server side.
    • Magento - phpBB3 - Kunena - RokBridge Specialist
      No Secure Tab posts unless requested.
      Use the Thank You and Life Preserver Buttons!
      Your signature is also great place for setup details...help us help you!

Time to create page: 0.055 seconds