html - My php script outputs a blank page -


i have php page accepts , processes form submission, page displays when requested, if page submitted , form validation fails, page suppose re-displayed form errors, on page re-display, php displays blank page when reaches error processing block. here code processes validation errors:

 <?php  if(isset($errorlog) , is_array($errorlog)): ?>                 <div class="alert alert-danger">                     <?php $output = '';                      if($errorlog['message'] == '') {                         $output = "<ul class='error-list'>";                          foreach($errorlog $key => $value) {                             if ($key != 'has_error_occured') {                                  $output .= "<li><strong>{html($key)}</strong>                                             <span>{html($value)} </span></li>";                             }                         }                         $output .= "</ul>";                      } else {                          $msg = $errorlog['message'];                        $output .= "<p>{html($msg)}</p>";                       }                      echo $output;                     ?>                 </div>             <?php endif; ?> 

and here code processes form submission

if(isset($_get['transfer']) or         (isset($_post['action']) , $_post['action'] == transfer)){          $transfer_type = $_get['ttype'];          if(isset($_post['action']) ,              $_post['action'] == transfer){              //process money transfer.             $log = process_transfer();             if(isset($log) , is_array($log)){                  if($log['has_error_occured']){                     $_session['error_log'] = $log;                      //unset log                     unset($log);                      include_once $docroot . '/users/temp/tranfer.html.php';                     exit();                 }else{                     $_session['transfer_msg'] = "your international                     transfer processed successfully";                      header('location: ?summary');                 }             }             //reload primary page.             header('location: .');           }else{              include_once $docroot . '/users/temp/tranfer.html.php';             exit();         }     } 

note:

  1. i have tried passing error array global variable can see in code snippet above.

  2. i have tried passing in session.

  3. i have tried using output buffering appending ob_start() @ beginning , ob_end_flush() @ end form script.

  4. i have added error_reporting(-1); ini_set('display_errors', true); @ start of form script know if page encounters error during processing, no avail.

  5. i using phpstorm xampp v3.2.1 development on windows 7.

please, cause of nightmare appreciated. thanks.

  1. if wanna use $_get , $_post better use $_request, allows access both $_get , $_post

  2. not transfer should "transfer"

  3. if errorlog session data should be

    if(isset($_session['errorlog']) , is_array($_session['errorlog'])):

  4. i didn't find thing created name message

    if($errorlog['message'] == '')

    why u used it, think must 'has_error_occured'


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -