Results 1 to 4 of 4

Thread: [RESOLVED] IE Refresh Issues

  1. #1

    Thread Starter
    Fanatic Member stickman373's Avatar
    Join Date
    Mar 2001
    Location
    MA
    Posts
    909

    [RESOLVED] IE Refresh Issues

    I have the code below, and the issue I'm having is when you run the script the first time in your browser and say the url is:

    filename.php?option=append

    That works fine. But say you edit the url to:

    filename.php?option=redo

    while still in the same browser window and then hit the green GO button on internet explorer. The message comes up saying the database rebuild was successful, but it actually doesnt do the rebuild. You actually have to hit the Refresh button in IE to make the MySQL rebuild actually occur. Does anyone know why?

    I find it wierd it echoes the right text but doesnt perform the other code. Please help

    PHP Code:
    <?php
        
        
        
    if($_GET['option'] == "")
        {
            
    $_GET['option'] = "append";
        }

        require(
    'databaseparameters.php');
        
        if(
    $_GET['option'] == "append")
        {
            
    $fcontents file ($csv_filename); 
            
            
    $dbh mysql_connect("localhost"$db_user$db_pass);
            
    mysql_select_db($db_name);
            
              for(
    $i=0$i<sizeof($fcontents); $i++) 
            { 
                  if(
    $i != 0)
                {
                    
    $line trim($fcontents[$i]); 
                      
    $arr explode(","$line); 
              
                      
    $sql "INSERT INTO ".$table_name." VALUES ('".implode("','"$arr) ."')"
                    
    mysql_query($sql);
                  }
              }
            
            echo 
    "Data Appended To MySQL Database!";
             
        }
        elseif(
    $_GET['option'] == "redo")
        {    
        
            
    $fcontents file ($csv_filename); 
            
            
    $dbh mysql_connect("localhost"$db_user$db_pass);
            
    mysql_select_db($db_name);
            
            
    //EMPTY THE TABLE FIRST
            
    $sql "DELETE FROM ".$table_name
            
    mysql_query($sql);

              for(
    $i=0$i<sizeof($fcontents); $i++) 
            { 
                  if(
    $i != 0)
                {    
                    
    $line trim($fcontents[$i]); 
                      
    $arr explode(","$line); 
                    
                      
    $sql "INSERT INTO ".$table_name." VALUES ('".implode("','"$arr) ."')"
                    
    mysql_query($sql);
                  }
              }
            
            echo 
    "MySQL Database Rebuild Complete!";
        }
        else
        {
            echo 
    "Error: Option Invalid";
        }

    ?><?php
        
        
        
    if($_GET['option'] == "")
        {
            
    $_GET['option'] = "append";
        }

        require(
    'databaseparameters.php');
        
        if(
    $_GET['option'] == "append")
        {
            
    $fcontents file ($csv_filename); 
            
            
    $dbh mysql_connect("localhost"$db_user$db_pass);
            
    mysql_select_db($db_name);
            
              for(
    $i=0$i<sizeof($fcontents); $i++) 
            { 
                  if(
    $i != 0)
                {
                    
    $line trim($fcontents[$i]); 
                      
    $arr explode(","$line); 
              
                      
    $sql "INSERT INTO ".$table_name." VALUES ('".implode("','"$arr) ."')"
                    
    mysql_query($sql);
                  }
              }
            
            echo 
    "Data Appended To MySQL Database!";
             
        }
        elseif(
    $_GET['option'] == "redo")
        {    
        
            
    $fcontents file ($csv_filename); 
            
            
    $dbh mysql_connect("localhost"$db_user$db_pass);
            
    mysql_select_db($db_name);
            
            
    //EMPTY THE TABLE FIRST
            
    $sql "DELETE FROM ".$table_name
            
    mysql_query($sql);

              for(
    $i=0$i<sizeof($fcontents); $i++) 
            { 
                  if(
    $i != 0)
                {    
                    
    $line trim($fcontents[$i]); 
                      
    $arr explode(","$line); 
                    
                      
    $sql "INSERT INTO ".$table_name." VALUES ('".implode("','"$arr) ."')"
                    
    mysql_query($sql);
                  }
              }
            
            echo 
    "MySQL Database Rebuild Complete!";
        }
        else
        {
            echo 
    "Error: Option Invalid";
        }

    ?>
    Last edited by stickman373; Dec 11th, 2004 at 02:24 PM.

  2. #2
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: IE Refresh Issues

    I think it would do it in any browser, not just IE. It's because you're going to the same page and the browser is loading it from cache, ignoring the parameters. Refreshing actually makes it look at the parameters in the URL and then it reparses the contents of the page.

    In other words, it has nothing to do with your script.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  3. #3

    Thread Starter
    Fanatic Member stickman373's Avatar
    Join Date
    Mar 2001
    Location
    MA
    Posts
    909

    Re: IE Refresh Issues

    Alright thanks for the info on that.

    I was able to put meta tags at the start of the file to force browser not to use cache.

    Thanks

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: IE Refresh Issues

    That's weird, though. The fact that the GET parameters changed means that the request is a different one, thus the browser should be REQUIRED to re-fetch.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

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



Click Here to Expand Forum to Full Width