Results 1 to 4 of 4

Thread: [RESOLVED] IE Refresh Issues

Threaded View

  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.

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