'tag.htm'; break; case 'flag': $pre .= $default_pre .= 'flag.htm'; break; case 'my': $pre .= $default_pre .= 'my.htm'; break; case 'my_password': $pre .= $default_pre .= 'my_password.htm'; break; case 'my_bind': $pre .= $default_pre .= 'my_bind.htm'; break; case 'my_avatar': $pre .= $default_pre .= 'my_avatar.htm'; break; case 'home_article': $pre .= $default_pre .= 'home_article.htm'; break; case 'home_comment': $pre .= $default_pre .= 'home_comment.htm'; break; case 'user': $pre .= $default_pre .= 'user.htm'; break; case 'user_login': $pre .= $default_pre .= 'user_login.htm'; break; case 'user_create': $pre .= $default_pre .= 'user_create.htm'; break; case 'user_resetpw': $pre .= $default_pre .= 'user_resetpw.htm'; break; case 'user_resetpw_complete': $pre .= $default_pre .= 'user_resetpw_complete.htm'; break; case 'user_comment': $pre .= $default_pre .= 'user_comment.htm'; break; case 'single_page': $pre .= $default_pre .= 'single_page.htm'; break; case 'search': $pre .= $default_pre .= 'search.htm'; break; case 'operate_sticky': $pre .= $default_pre .= 'operate_sticky.htm'; break; case 'operate_close': $pre .= $default_pre .= 'operate_close.htm'; break; case 'operate_delete': $pre .= $default_pre .= 'operate_delete.htm'; break; case 'operate_move': $pre .= $default_pre .= 'operate_move.htm'; break; case '404': $pre .= $default_pre .= '404.htm'; break; case 'read_404': $pre .= $default_pre .= 'read_404.htm'; break; case 'list_404': $pre .= $default_pre .= 'list_404.htm'; break; default: $pre .= $default_pre .= theme_mode_pre(); break; } if ($config['theme']) { $conffile = APP_PATH . 'view/template/' . $config['theme'] . '/conf.json'; $json = is_file($conffile) ? xn_json_decode(file_get_contents($conffile)) : array(); } !empty($json['installed']) and $path_file = APP_PATH . 'view/template/' . $config['theme'] . '/htm/' . ($id ? $id . '_' : '') . $pre; (empty($path_file) || !is_file($path_file)) and $path_file = APP_PATH . 'view/template/' . $config['theme'] . '/htm/' . $pre; if (!empty($config['theme_child']) && is_array($config['theme_child'])) { foreach ($config['theme_child'] as $theme) { if (empty($theme) || is_array($theme)) continue; $path_file = APP_PATH . 'view/template/' . $theme . '/htm/' . ($id ? $id . '_' : '') . $pre; !is_file($path_file) and $path_file = APP_PATH . 'view/template/' . $theme . '/htm/' . $pre; } } !is_file($path_file) and $path_file = APP_PATH . ($dir ? 'plugin/' . $dir . '/view/htm/' : 'view/htm/') . $default_pre; return $path_file; } function theme_mode_pre($type = 0) { global $config; $mode = $config['setting']['website_mode']; $pre = ''; if (1 == $mode) { $pre .= 2 == $type ? 'portal_category.htm' : 'portal.htm'; } elseif (2 == $mode) { $pre .= 2 == $type ? 'flat_category.htm' : 'flat.htm'; } else { $pre .= 2 == $type ? 'index_category.htm' : 'index.htm'; } return $pre; } ?>php下载卡住,php
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php下载卡住,php

运维笔记admin96浏览0评论

php下载卡住,php

php下载卡住,php

嗨,我正在以excel格式导出我的mysql数据,目前我有14k记录,但问题是它卡住了@ 188kb,但是当我尝试将结果缩减为100条记录时,它不会中断下载.

这是我的代码:

function xlsBOF() {

echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);

return;

}

function xlsEOF() {

echo pack("ss", 0x0A, 0x00);

return;

}

function xlsWriteNumber($Row, $Col, $Value) {

echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);

echo pack("d", $Value);

return;

}

function xlsWriteLabel($Row, $Col, $Value ) {

$L = strlen($Value);

echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);

echo $Value;

return;

}

mysql_connect($dbhost,$dbuser,$dbpass);

//mysql_select_db($dbname) or die("Unable to select database");

$result = mysql_db_query($dbname, "select id, or_number, name, client_code, address, vehicle_info, vehicle_color, plate_num, sticker_type, application_date, amount_paid, traffic_violations, delivery_date, edited_by, phase, version FROM owner order by application_date desc");

// Send Header

header("Pragma: public");

header("Expires: 0");

header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

header("Content-Type: application/force-download");

header("Content-Type: application/octet-stream");

header("Content-Type: application/download");;

header("Content-Disposition: attachment;filename=epal.xls"); // à?à??à?‰à?§à??à??à??à?à??à??à?·à??à??à??à??à??à??

header("Content-Transfer-Encoding: binary ");

xlsBOF();

xlsWriteLabel(0,0,"Current SLVA Owner List:");

xlsWriteLabel(2,0,"#");

xlsWriteLabel(2,1,"OR #");

xlsWriteLabel(2,2,"Name");

xlsWriteLabel(2,3,"Client Code");

xlsWriteLabel(2,4,"Address");

xlsWriteLabel(2,5,"Vehicle Info");

xlsWriteLabel(2,6,"Vehicle Color");

xlsWriteLabel(2,7,"Plate #");

xlsWriteLabel(2,8,"Sticker Type");

xlsWriteLabel(2,9,"Application Date");

xlsWriteLabel(2,10,"Amount Paid");

xlsWriteLabel(2,11,"Traffic Violations");

xlsWriteLabel(2,12,"Delivery Date");

xlsWriteLabel(2,13,"Edited By");

xlsWriteLabel(2,14,"Phase");

xlsWriteLabel(2,15,"Version");

$xlsRow = 3;

while(list($id, $or_number, $name, $client_code, $address, $vehicle_info, $vehicle_color, $plate_num, $sticker_type, $application_date, $amount_paid, $traffic_violations, $delivery_date, $edited_by, $phase, $version) = mysql_fetch_row($result)) {

xlsWriteLabel($xlsRow,0, $id);

xlsWriteLabel($xlsRow,1,$or_number);

xlsWriteLabel($xlsRow,2,$name);

xlsWriteLabel($xlsRow,3,$client_code);

xlsWriteLabel($xlsRow,4,$address);

xlsWriteLabel($xlsRow,5,$vehicle_info);

xlsWriteLabel($xlsRow,6,$vehicle_color);

xlsWriteLabel($xlsRow,7,$plate_num);

xlsWriteLabel($xlsRow,8,$sticker_type);

xlsWriteLabel($xlsRow,9,$application_date);

xlsWriteLabel($xlsRow,10,$amount_paid);

xlsWriteLabel($xlsRow,11,$traffic_violations);

xlsWriteLabel($xlsRow,12,$delivery_date);

xlsWriteLabel($xlsRow,13,$edited_by);

xlsWriteLabel($xlsRow,14,$phase);

xlsWriteLabel($xlsRow,15,$version);

$xlsRow++;

}

xlsEOF();

exit();

我去了几个站点/线程,但仍然没有找到解决方案. :'(

发布评论

评论列表(0)

  1. 暂无评论