Jump to content

Recommended Posts

I've been using an export that works great with firefox, but IE exports all of the data to a single page.  Would anyone be able to help me out with why IE doesn't like it?

 

This is my code for it:

 

    if (isset($_SESSION['searchData']) AND isset($_SESSION['searchFields']) AND $valid == 1)
    {
    header("Content-Disposition: attachment; filename=branch.csv");

          $errorList = array();

          if (sizeof($errorList) == 0)
          {
                echo $_SESSION['searchTitle']."\n\n";
                echo $_SESSION['searchFields'];
                echo ("\n\n");

                //START FILLING IN THE ROWS IN EXCEL SHEET.
                $sql = $_SESSION['searchData'];
                $getInfo = mysql_query($sql);
                while($row = mysql_fetch_array($getInfo, MYSQL_ASSOC))
                {
                  while (list($key, $value) = each($row))
                  {
                    //If a row needs to have it's value changed before going into the cls file, perform it here using it's sql name
                    if($key == 'registration'){if($value == 1) $value = 'Yes'; else $value = 'No';}
                    if($key == 'training'){if($value == 1) $value = 'Yes'; else $value = 'No';}
                    if($key == 'language'){if($value == 'e') $value = 'English'; else $value = 'French';}
                    if($key == 'photograph'){if($value == 1) $value = 'Yes'; else $value = 'No';}

                    echo ("$value" . ",");
                  }
                  echo ("\n");
                }
                mysql_close($conn);
           }
           else
           {
              listErrors();
           }
   }

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/111694-solved-export-csv-and-internet-explorer/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.