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)