お世話になります。
PHPからHTMLへの出力で不可思議な現象があったため、確認をさせてください。
PHPのコードの概略は以下のとおりです。
ここで最下部の<a href="a_input_all.php" class="button">戻る</a>について
Ⅰ.ループ処理を行っている、処理_Cを3回までのループさせている場合には表示され4回以上の処理を行う場合には
これが表示されなくなります。
Ⅱ.要素検証を行うと3回までのループは適切に処理されていることが確認でき、4回以上の処理の場合にはその直前の
Ⅲ.ループで処理している内容はそこそこ重たい処理、(3回ループでも10秒以上を要します)と思われます。
Ⅳ.ChromeでもIEでも同じ手続きをしてみましたが、結果は同様でした。
という現状なのですが、なぜこのような現象が起きるのか分からなかったため
もしご経験やアドバイスがあればお尋ねしたく思います。
PHP
1 2 3<!DOCTYPE html> 4<html> 5 <head> 6 <meta charset="utf-8"> 7 <title>確認画面</title> 8 <link rel="stylesheet" href="./C_css/style.css"> 9 </head> 10 <body> 11 12<?php if (empty($_SESSION['correct'])):?> 13処理_A 14 <?php else:?> 15 <?php if(is_array_empty($resultError))//配列の要素が全て空であるか検証する関数:?> 16 処理_B 17 <?php else:?> 18 処理_C 19 <?php endif;?> 20<?php endif;?> 21 22<a href="a_input_all.php" class="button">戻る</a> 23</body> 24</html>
PHP
1処理_Cの詳細 2<?php else:?> 3 <?php 4 for ($i=$start; $i <$end ; $i++) { 5 $counting=count($resultAlter[$secid[$i]]); 6 echo "<b><u>結果レポート:".$secid[$i]."</u></b><br>"; 7 echo '<div style=" width:500px; border:1px solid #000000; padding:10px">'; 8 echo "登録が完了しました。".$counting."事業年度分の内訳は下記の通りです"."<br>"; 9 for ($r=0; $r <$counting ; $r++) { 10 $counting1=count($resultAlter[$secid[$i]][$r]); 11 $ttl[]=$counting1; 12 echo "■".$scan[$r+2].":".$counting1."件"."<br>"; 13 14 try 15 { 16 $stmt_A = $pdo->prepare("INSERT IGNORE INTO all_fsdb 17 (entityName,entityCode,taxonomyNameEng,taxonomyNameJpn,amout,amtDecimals,fsCategory,taxonomySource,accumName,yearEnd,period,unq) 18 VALUES (:entityName,:entityCode,:taxonomyNameEng,:taxonomyNameJpn,:amout,:amtDecimals,:fsCategory,:taxonomySource,:accumName,:yearEnd,:period,:unq)"); 19 for ($u=0; $u <$counting1 ; $u++) { 20 $stmt_A->BindValue(':entityName',$result[$secid[$i]][$r][$u][11],PDO::PARAM_STR); 21 $stmt_A->BindParam(':entityCode',$result[$secid[$i]][$r][$u][12],PDO::PARAM_INT); 22 $stmt_A->BindValue(':taxonomyNameEng',$result[$secid[$i]][$r][$u][1],PDO::PARAM_STR); 23 $stmt_A->BindValue(':taxonomyNameJpn',$result[$secid[$i]][$r][$u][5],PDO::PARAM_STR); 24 $stmt_A->BindParam(':amout',$result[$secid[$i]][$r][$u][2],PDO::PARAM_INT); 25 $stmt_A->BindParam(':amtDecimals',$result[$secid[$i]][$r][$u][3],PDO::PARAM_INT); 26 $stmt_A->BindValue(':fsCategory',$result[$secid[$i]][$r][$u][4],PDO::PARAM_STR); 27 $stmt_A->BindValue(':taxonomySource',$result[$secid[$i]][$r][$u][6],PDO::PARAM_STR); 28 $stmt_A->BindValue(':accumName',$result[$secid[$i]][$r][$u][7],PDO::PARAM_STR); 29 $stmt_A->BindParam(':yearEnd',$result[$secid[$i]][$r][$u][8],PDO::PARAM_INT); 30 $stmt_A->BindParam(':period',$result[$secid[$i]][$r][$u][9],PDO::PARAM_INT); 31 $stmt_A->BindValue(':unq',$result[$secid[$i]][$r][$u][10],PDO::PARAM_STR); 32 $stmt_A->execute(); 33 } 34 } 35 catch (PDOException $e) 36 { 37 var_dump($e->getMessage()); 38 } 39 40 } 41 echo ("<br>合計で".array_sum($ttl)."件のレコードが登録されました"."<br>"); 42 $ttl=array(); 43 if (empty($resultError[$secid[$i]])) { 44 }else{ 45 echo '<p style="color:#ff0000;">(注)以下の'.count($resultError[$secid[$i]]).'件のレコードを除外して 登録いたしました<p><br>'; 46 prep($resultError[$secid[$i]]); 47 } 48 echo '</div>'; 49 } 50 ?> 51 <br> 52 <a href="a_input_all.php" class="button">戻る</a> 53 <?php 54 $_SESSION = array(); 55 if (isset($_COOKIE[session_name()])) { 56 setcookie(session_name(), '', time()-42000, '/');} 57 session_destroy(); 58 ?> 59<?php endif;?>
回答4件
あなたの回答
tips
プレビュー