Problems related to incomplete loading of php pages

Source: Internet
Author: User
Urgent !! Php page loading is not complete, online RT, the same page is refreshed multiple times, sometimes normal, sometimes only show half, sometimes this problem is not encountered during local debugging when the page is completely blank and half is completely blank. This occurs when the external network is released. The content in the drop-down box opens a. tab file with fopen, reads the file, converts it into an array through loop, and assigns values to the js array through loop. The loop is 1. URGENT !! Incomplete php page loading, online, etc.
RT: refresh the same page multiple times. sometimes it is normal, sometimes it is only half displayed, and sometimes it is completely blank.
Complete page

Half


This problem was not encountered during local debugging, which occurred during the release of the Internet. The content in the drop-down box opens a. tab file with fopen, reads it, converts it into an array through loops, and assigns values to the js array through loops. The loop is 1000.
Set_time_limit (60*60*10) is invalid...
Thank you for your guidance... Attach some code

Common. php
Public static function readTabFile ($ fileName)
{
If (! File_exists ($ fileName ))
{
Die ("404 File not found!");
}
$ Handle = fopen ($ fileName, 'RB ');
$ Contents = fread ($ handle, filesize ($ fileName ));

// Iconv ("UTF-8", "GBK", $ contents );

If (ord ($ contents) = 0xEF)
{
$ Contents = substr ($ contents, 4 );
}
$ Rows = explode ("\ r \ n", $ contents );
Fclose ($ handle );
$ Ret;
$ ColNames = null;
For ($ I = 0; $ I <count ($ rows); $ I ++)
{
$ Row = $ rows [$ I];
If (! Empty ($ row) & $ row! = "" & Substr ($ row, 0, 1 )! = "#")
{
$ Col = explode ("\ t", $ row );
If (empty ($ colNames) | $ colNames = null)
$ ColNames = $ col;
Else
{
$ Item;
$ ItemId = (int) $ col [0];
If (empty ($ itemId ))
{
Die ("...");
}
For ($ j = 0; $ j <count ($ col); $ j ++)
{
$ Value = $ col [$ j];

$ Item [$ colNames [$ j] = $ value;
}
$ Ret [$ itemId] = $ item;
}
}
}
Return $ ret;

}
?>
Test. php
$ Dir = "../goods. tab ";
$ Table = Common: readTabFile ($ dir );
?>
Script
Var goodsTb = new Array ();

Foreach ($ table as $ key => $ value)
{
Echo "goodsTb [". $ value ["id"]. "] = \"". iconv ("GBK", "UTF-8", $ value ["sz_name"]). "\";";
}
?>
Function checkNum (I)
{
Var sle_obj = document. getElementById ('valuetype '+ I );
Var index = sle_obj.selectedIndex;
Var valueType = sle_obj.options [index]. value;
Var num_obj = document. getElementById ('count' + I );
If (valueType =-1)
{
Alert ('select the item type! ');
}
If (num_obj.value> 500)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.