[PHP-DB] Program Dies
Dear List - Thank you ever so much for all your help. I apologize in advance for dumping all this code on you. I cannot get any debugger to work for me [see my separate email on debuggers]. I placed numerous echo and print_r statements in the code, and could not find the error. The program worked perfectly previously, and now it dies. It mimic a doctor's office where a study is being performed on obesity. The parameter is a calculated value called BMI. In the initial part of the program, a search is performed to obtain the medical record . This works perfectly. The second step is to obtain data at the patient visit, which is triggered by a button Do you wish to enter visit data? If that button is clicked, the program returns to the original welcome screen. Advice and help, please. Here is the code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html head titleSearch of Initial Input Data/title style type=text/css table { border-collapse: collapse; } td { border-top: 1px solid #000; border-bottom: 1px solid #000; border-left:1px solid #000; border-right: 1px solid #000; } tr { border-top: 1px solid #000; border-bottom: 1px solid #000; border-left:1px solid #000; border-right: 1px solid #000; } #more{ margin-top: 90%; } #vs{ position: absolute; left: 46%; } #vs2{ position: absolute; left: 44%; } /style /head body strongcenterSearch of Input Data/strong/center pre ?php session_start(); ini_set('display_errors', 'On'); ini_set('display_startup_errors', 'On'); error_reporting(E_ALL); $fptr2=fopen(/var/www/scratch.txt, r+); require '/var/www/pass.inc'; $db = hospital2; $cxn = mysqli_connect($host,$user,$password,$db); if (!$cxn) { die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); } mysqli_select_db($cxn, hospital2); global $n1; $n1 = 1; $flag =1; global $Mdr; global $cxn; global $Date; global $MedRec; global $medrec; global $result; global $result1; global $result2; global $result43; global $result5; global $result6; global $result7; global $result8; global $query; global $MedRec2; global $row1; global $row2; global $row3; global $row4; global $row5; global $row6; static $_GLOBALS; global $query; global $not_yet; $not_yet = 1; global $setter; $setter = 0; global $errors_array; if(!isset($_REQUEST[welcome_already_seen])) { $_POST['Site'] = ''; $_POST['MedRec'] = ''; $_POST['Fname'] = ''; $_POST['Lname'] = ''; $_POST['Phone'] = ''; $_POST['Sex']= ''; $_POST['Height'] = ''; } $errors_array = array(); if($_REQUEST[welcome_already_seen]== already_seen) { check_data(); if(count($errors_array) != 0) { echo start #1; show_errors(); show_welcome(); } else { show_welcome(); handle_data($cxn); } } if(!isset($_REQUEST[welcome_already_seen])) show_welcome(); global $errors; $errors = 0; function check_data() { global $errors_array; global $errors; if(!empty($_POST['Fname'])) if(preg_match('#^[a-zA-Z]\w#', $_POST['Fname'])== 0) { $errors_array[] = centerbfont color='red'First Name must be Text/font/center/b; $errors = 1; } if(!empty($_POST['Lname'])) if(preg_match('#^[a-zA-Z]\w#', $_POST['Lname'])== 0) { $errors_array[] = centerbfont color='red'Last Name must be Text/font/center/b; $errors = 1; } if(!empty($_POST['Site'])) if(preg_match('#^[A-Z]\w{1}#', $_POST['Site'])== 0) { $errors_array[] = centerbfont color='red'Site must be TWO CAPITAL LETTERS/font/center/b; $errors = 1; } if(!empty($_POST['MedRec'])) if(preg_match('#^\d{5}$#', $_POST['MedRec']) == 0) { $errors_array[] = centerbfont color='red'Medical Record must be FIVE NUMBERS/font/center/b; $errors = 1; } if(!empty($_POST['Height'])) if(preg_match('#^[5-6]{1}$|^[5-6]{1}[0-9]{1}$#', $_POST['Height']) == 0) { $errors_array[] = centerbfont color='red'Height must be between 50 and 69/font/center/b;
Re: [PHP-DB] Program Dies
On Sun, Oct 14, 2012 at 11:57 PM, Ethan Rosenberg, PhD erosenb...@hygeiabiomedical.com wrote: Dear List - Thank you ever so much for all your help. I apologize in advance for dumping all this code on you. I cannot get any debugger to work for me [see my separate email on debuggers]. I placed numerous echo and print_r statements in the code, and could not find the error. The program worked perfectly previously, and now it dies. It mimic a doctor's office where a study is being performed on obesity. The parameter is a calculated value called BMI. In the initial part of the program, a search is performed to obtain the medical record . This works perfectly. The second step is to obtain data at the patient visit, which is triggered by a button Do you wish to enter visit data? If that button is clicked, the program returns to the original welcome screen. Advice and help, please. Here is the code: Ethan, I'd love to help you out, but you really can't expect anybody from this mailing list to read through 633 lines of code... - Matijn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Program Dies
On Oct 14, 2012, at 4:57 PM, Ethan Rosenberg, PhD wrote: Dear List - Thank you ever so much for all your help. I apologize in advance for dumping all this code on you. I cannot get any debugger to work for me [see my separate email on debuggers]. I placed numerous echo and print_r statements in the code, and could not find the error. The program worked perfectly previously, and now it dies. It mimic a doctor's office where a study is being performed on obesity. The parameter is a calculated value called BMI. In the initial part of the program, a search is performed to obtain the medical record . This works perfectly. The second step is to obtain data at the patient visit, which is triggered by a button Do you wish to enter visit data? If that button is clicked, the program returns to the original welcome screen. Advice and help, please. Here is the code: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html head titleSearch of Initial Input Data/title style type=text/css table { border-collapse: collapse; } td { border-top: 1px solid #000; border-bottom: 1px solid #000; border-left:1px solid #000; border-right: 1px solid #000; } tr { border-top: 1px solid #000; border-bottom: 1px solid #000; border-left:1px solid #000; border-right: 1px solid #000; } #more{ margin-top: 90%; } #vs{ position: absolute; left: 46%; } #vs2{ position: absolute; left: 44%; } /style /head body strongcenterSearch of Input Data/strong/center pre ?php session_start(); ini_set('display_errors', 'On'); ini_set('display_startup_errors', 'On'); error_reporting(E_ALL); $fptr2=fopen(/var/www/scratch.txt, r+); require '/var/www/pass.inc'; $db = hospital2; $cxn = mysqli_connect($host,$user,$password,$db); if (!$cxn) { die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); } mysqli_select_db($cxn, hospital2); global $n1; $n1 = 1; $flag =1; global $Mdr; global $cxn; global $Date; global $MedRec; global $medrec; global $result; global $result1; global $result2; global $result43; global $result5; global $result6; global $result7; global $result8; global $query; global $MedRec2; global $row1; global $row2; global $row3; global $row4; global $row5; global $row6; static $_GLOBALS; global $query; global $not_yet; $not_yet = 1; global $setter; $setter = 0; global $errors_array; if(!isset($_REQUEST[welcome_already_seen])) { $_POST['Site'] = ''; $_POST['MedRec'] = ''; $_POST['Fname'] = ''; $_POST['Lname'] = ''; $_POST['Phone'] = ''; $_POST['Sex']= ''; $_POST['Height'] = ''; } $errors_array = array(); if($_REQUEST[welcome_already_seen]== already_seen) { check_data(); if(count($errors_array) != 0) { echo start #1; show_errors(); show_welcome(); } else { show_welcome(); handle_data($cxn); } } if(!isset($_REQUEST[welcome_already_seen])) show_welcome(); global $errors; $errors = 0; function check_data() { global $errors_array; global $errors; if(!empty($_POST['Fname'])) if(preg_match('#^[a-zA-Z]\w#', $_POST['Fname'])== 0) { $errors_array[] = centerbfont color='red'First Name must be Text/font/center/b; $errors = 1; } if(!empty($_POST['Lname'])) if(preg_match('#^[a-zA-Z]\w#', $_POST['Lname'])== 0) { $errors_array[] = centerbfont color='red'Last Name must be Text/font/center/b; $errors = 1; } if(!empty($_POST['Site'])) if(preg_match('#^[A-Z]\w{1}#', $_POST['Site'])== 0) { $errors_array[] = centerbfont color='red'Site must be TWO CAPITAL LETTERS/font/center/b; $errors = 1; } if(!empty($_POST['MedRec'])) if(preg_match('#^\d{5}$#', $_POST['MedRec']) == 0) { $errors_array[] = centerbfont color='red'Medical Record must be FIVE NUMBERS/font/center/b; $errors = 1; } if(!empty($_POST['Height'])) if(preg_match('#^[5-6]{1}$|^[5-6]{1}[0-9]{1}$#', $_POST['Height']) == 0) { $errors_array[] = centerbfont color='red'Height must be between 50 and 69/font/center/b; $errors = 1; }