Jump to content

Recommended Posts

Hey, I should start off saying I have never written a script nor worked with server side code like php. That being said, I found examples all over the web, tried to find combinations of code till I finally just started from the basics and tried to write it myself, and somehow ended up getting a code that actually works.

 

So I have a basic HTML form that needs to have all data from the form sent to a csv file. This works!

Now I applied it to a much bigger form that I wrote html code for, but I am having problems applying the php code.

 

It needs some work for the checkboxes; header(sending it to a url it doesnt do it); writing it to a csv fileValidating the first, last, email, age, before submitting; how to not move on if those aren't there. but the rest are fine being blank at times.

radios also when checked by accident can't be unchecked or go to our open text boxes to write their "other" possible treatment

 

 

I cant upload the csv's but they are simple, just having the heading of each section.

basicform.php

fputcsv.php

index.php

list of values and ids.txt

Sorry I forgot I was testing this with an xlsx file for that index.php, but it should be

$fp = fopen('WrenDB.csv', 'a+');

and I changed the action="index.php" to:

   <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="WrenForm" id="WrenForm">

That's an extremely long form.

I fixed most the errors and also many other items.

Retaining the post values in form and mark the selected. Just top area though, you can look at that and do similar the rest your form.

The radio in forms uses checked versus the dropdown using selected.

Moving all html below and doing a delay on the header with a message.

 

It's going to be hard for you to determine those optional and imploded post arrays, I usually push new values to an array and name them with an associative array, then again I also use a database.

 

In this code the csv filename is the date,time,lastname,firstname

Make a folder and save them all one location, shouldn't get duplicates or overwritten now.

<?php
date_default_timezone_set('UTC');
$errors = array();

$middlename = $race = $homePhone = $cellPhone = $workPhone = $dateofdiagnosis = $FamilyHistory = $dateofbloodresults = $AbnormNET = $AbnormCGA = $AbnormPancrea = $AbnormSerotonin = $AbnormU5IAA = $AbnormOtherBiomarker = $PrimaryLocation = $cancerStatus = $cancerStage = $SecondaryLocation = $Histopathology = $HistopathologyLung = $HistopathologyGEPNET = $HistopathologyKi67 = $HistopathologyMitosesLUNG = $HistopathologyMitosesGEPNETS = $Ostreoscan = $OstreoscanDate = $OstreoscanPosNeg = $OstreoscanArea = $OstreoscanLiverLobe = $OstreoscanLesions = $OstreoscanUptake = $CTScan = $CTScanDate = $CTScanPosNeg = $CTScanArea = $CTScanLiverLobe = $CTScanLesions = $CTScanLesions = $CTScanSizeofMeta = $MRIScan = $MRIScanDate = $MRIScanPosNeg = $MRIScanArea = $MRIScanLiverLobe = $MRIScanLesions = $MRIScanSizeofMeta = $FDGScan = $FDGScanDate = $FDGScanPosNeg = $FDGScanArea = $FDGScanLiverLobe = $FDGScanLesions = $FDGScanL1 = $FDGScanL2 = $FDGScanL3 = $FDGScanL4 = $FDGScanL5 = $IstopeImaging = $IstopeImageDate = $IsotopeConjugad = $IsotopeL1 = $IsotopeL2 = $IsotopeL3 = $IsotopeL4 = $IsotopeL5 = $PrimarySurgery = $PrimarySurgeryDate = $PrimaryGISurgery = $PrimaryLungSurgery = $MetastasesSurgery = $MetastasesSurgeryDate = $MetastasesLiverSurgery = $MetastasesLungSurgery = $Staging = $StagingDate = $StagingNum = $Interventions = $InterventionDate = $TypeInter = $PRRT = $PRRTDate = $TypePRRT = $NumCycles = $PRRTDose = $SSasDate = $SSAsType = $SSAsAmount = $Everolimus = $EverolimusDate = $Sunitnib = $SunitnibDate = $Bevacizumab = $BevacizumabDate = $Chemotherapy = $ChemoDate = "";
$DiagnosisModality = $signs = $symptoms = $Hematology = $Hepatic = $Renal = $Biomarkers = $IsotopeConjugad = $ChemoTreatment = '';

if (isset($_POST["submit"])) {
    
    if (isset($_POST["lastname"]) && trim($_POST["lastname"]) != '') {
        $lastname = trim($_POST["lastname"]);
    } else {
        $lastname           = '';
        $errors['lastname'] = "Last Name is required";
    }
    
    if (isset($_POST["firstname"]) && trim($_POST["firstname"]) != '') {
        $firstname = trim($_POST["firstname"]);
    } else {
        $firstname           = '';
        $errors['firstname'] = "First Name is required";
    }
    
    if (isset($_POST["middlename"])) {
        $middlename = $_POST["middlename"];
    } else {
        $middlename = '';
    }
    
    if (isset($_POST["age"]) && ctype_digit(trim($_POST["age"]))) {
        $age = trim($_POST["age"]);
    } else {
        $age           = '';
        $errors['age'] = "Age is required";
    }
    
    if (isset($_POST["email"]) && filter_var(trim($_POST["email"]), FILTER_VALIDATE_EMAIL)) {
        $email = trim($_POST["email"]);
    } else {
        $email           = '';
        $errors['email'] = "Email is required";
    }
    
    if (isset($_POST["race"]) && trim($_POST["race"]) != '') {
        $race = trim($_POST["race"]);
    } else {
        $race = '';
    }
    
    if (isset($_POST["gender"]) && trim($_POST["gender"]) != '') {
        $gender = trim($_POST["gender"]);
    } else {
        $gender           = '';
        $errors['gender'] = "Gender is required";
    }
    
    if (isset($_POST["homePhone"]) && trim($_POST["homePhone"]) != '') {
        $homePhone = $_POST["homePhone"];
    }
    
    if (isset($_POST["cellPhone"]) && trim($_POST["cellPhone"]) != '') {
        $cellPhone = $_POST["cellPhone"];
    }
    if (isset($_POST["workPhone"]) && trim($_POST["workPhone"]) != '') {
        $workPhone = $_POST["workPhone"];
    }
    if (isset($_POST["dod"])) {
        $dateofdiagnosis = $_POST["dod"];
    }
    if (isset($_POST["DiagnosisModality"])) {
        $DiagnosisModality = implode(",", $_POST["DiagnosisModality"]);
    }
    if (isset($_POST["signs"])) {
        $signs = implode(",", $_POST["signs"]);
    }
    if (isset($_POST["symptoms"])) {
        $symptoms = implode(",", $_POST["symptoms"]);
    }
    if (isset($_POST["FamilyHistory"])) {
        $FamilyHistory = $_POST["FamilyHistory"];
    }
    if (isset($_POST["dobr"])) {
        $dateofbloodresults = $_POST["dobr"];
    }
    if (isset($_POST["Hematology"])) {
        $Hematology = implode(",", $_POST["Hematology"]);
    }
    if (isset($_POST["Hepatic"])) {
        $Hepatic = implode(",", $_POST["Hepatic"]);
    }
    if (isset($_POST["Renal"])) {
        $Renal = implode(",", $_POST["Renal"]);
    }
    if (isset($_POST["Biomarkers"])) {
        $Biomarkers = implode(",", $_POST["Biomarkers"]);
    }
    if (isset($_POST["AbnormalElevatedNETest"])) {
        $AbnormNET = $_POST["AbnormalElevatedNETest"];
    }
    if (isset($_POST["AbnormalElevatedCgA"])) {
        $AbnormCGA = $_POST["AbnormalElevatedCgA"];
    }
    if (isset($_POST["AbnormalElevatedPancreastatin"])) {
        $AbnormPancrea = $_POST["AbnormalElevatedPancreastatin"];
    }
    if (isset($_POST["AbnormalElevatedSerotonin"])) {
        $AbnormSerotonin = $_POST["AbnormalElevatedSerotonin"];
    }
    if (isset($_POST["AbnormalElevatedU5HIAA"])) {
        $AbnormU5IAA = $_POST["AbnormalElevatedU5HIAA"];
    }
    if (isset($_POST["AbnormalElevatedOtherBiomarker"])) {
        $AbnormOtherBiomarker = $_POST["AbnormalElevatedOtherBiomarker"];
    }
    if (isset($_POST["PrimaryLocation"])) {
        $PrimaryLocation = $_POST["PrimaryLocation"];
    }
    if (isset($_POST["cancerStatus"])) {
        $cancerStatus = $_POST["cancerStatus"];
    }
    if (isset($_POST["cancerStage"])) {
        $cancerStage = $_POST["cancerStage"];
    }
    if (isset($_POST["SecondaryLocation"])) {
        $SecondaryLocation = $_POST["SecondaryLocation"];
    }
    if (isset($_POST["Histopathology"])) {
        $Histopathology = $_POST["Histopathology"];
    }
    if (isset($_POST["HistopathologyLung"])) {
        $HistopathologyLung = $_POST["HistopathologyLung"];
    }
    if (isset($_POST["HistopathologyGEPNET"])) {
        $HistopathologyGEPNET = $_POST["HistopathologyGEPNET"];
    }
    if (isset($_POST["HistopathologyKi67"])) {
        $HistopathologyKi67 = $_POST["HistopathologyKi67"];
    }
    if (isset($_POST["HistopathologyMitoses(Lung)"])) {
        $HistopathologyMitosesLUNG = $_POST["HistopathologyMitoses(Lung)"];
    }
    
    $HistopathologyMitosesGEPNETS = $_POST["HistopathologyMitoses(GEP-NETs)"];
    $Ostreoscan                   = $_POST["Ostreoscan"];
    $OstreoscanDate               = $_POST["OstreoscanDate"];
    $OstreoscanPosNeg             = $_POST["Ostreoscan+/-"];
    $OstreoscanArea               = $_POST["OstreoscanArea"];
    $OstreoscanLiverLobe          = $_POST["OstreoscanLiverLobe"];
    $OstreoscanLesions            = $_POST["OstreoscanLesions"];
    $OstreoscanUptake             = $_POST["OstreoscanUptake"];
    $CTScan                       = $_POST["CTScan"];
    $CTScanDate                   = $_POST["CTScanDate"];
    $CTScanPosNeg                 = $_POST["CTScan+/-"];
    $CTScanArea                   = $_POST["CTScanArea"];
    $CTScanLiverLobe              = $_POST["CTScanLiverLobe"];
    $CTScanLesions                = $_POST["CTScanLesions"];
    $CTScanSizeofMeta             = $_POST["CTScanSizeofMetastases"];
    $MRIScan                      = $_POST["MRIScan"];
    $MRIScanDate                  = $_POST["MRIScanDate"];
    $MRIScanPosNeg                = $_POST["MRIScan+/-"];
    $MRIScanArea                  = $_POST["MRIScanArea"];
    $MRIScanLiverLobe             = $_POST["MRIScanLiverLobe"];
    $MRIScanLesions               = $_POST["MRIScanLesions"];
    $MRIScanSizeofMeta            = $_POST["MRIScanSizeofMetastases"];
    $FDGScan                      = $_POST["FDGScan"];
    $FDGScanDate                  = $_POST["FDGScanDate"];
    $FDGScanPosNeg                = $_POST["FDGScan+/-"];
    $FDGScanArea                  = $_POST["FDGScanArea"];
    $FDGScanLiverLobe             = $_POST["FDGScanLiverLobe"];
    $FDGScanLesions               = $_POST["FDZGScanLesions"];
    $FDGScanL1                    = $_POST["FDGScanL1SUVmax"];
    $FDGScanL2                    = $_POST["FDGScanL2SUVmax"];
    $FDGScanL3                    = $_POST["FDGScanL3SUVmax"];
    $FDGScanL4                    = $_POST["FDGScanL4SUVmax"];
    $FDGScanL5                    = $_POST["FDGScanL5SUVmax"];
    $IstopeImaging                = $_POST["IstopeImaging"];
    $IstopeImageDate              = $_POST["IstopeImageDate"];
    if (isset($_POST["IsotopeTracer"])) {
        $IstopeTracer = implode(",", $_POST["IsotopeTracer"]);
    }
    $IstopeTracerWorking = $_POST["IstopeTracerWorking"];
    if (isset($_POST["IsotopeConjugad"])) {
        $IsotopeConjugad = implode(",", $_POST["IsotopeConjugad"]);
    }
    $IsotopeL1              = $_POST["IsotopeL1SUVmax"];
    $IsotopeL2              = $_POST["IsotopeL2SUVmax"];
    $IsotopeL3              = $_POST["IsotopeL3SUVmax"];
    $IsotopeL4              = $_POST["IsotopeL4SUVmax"];
    $IsotopeL5              = $_POST["IsotopeL5SUVmax"];
    $PrimarySurgery         = $_POST["PrimarySurgery"];
    $PrimarySurgeryDate     = $_POST["PrimarySurgeryDate"];
    $PrimaryGISurgery       = $_POST["PrimaryGITractSurgery"];
    $PrimaryLungSurgery     = $_POST["PrimaryLungSurgery"];
    $MetastasesSurgery      = $_POST["MetastasesSurgery"];
    $MetastasesSurgeryDate  = $_POST["MetastasesSurgeryDate"];
    $MetastasesLiverSurgery = $_POST["MetastasesLiverSurgery"];
    $MetastasesLungSurgery  = $_POST["MetastasesLungSurgery"];
    $Staging                = $_POST["Staging"];
    $StagingDate            = $_POST["StagingDate"];
    $StagingNum             = $_POST["Staging#"];
    $Interventions          = $_POST["Interventions"];
    $InterventionDate       = $_POST["InterventionDate"];
    $TypeInter              = $_POST["TypeofInterventions"];
    $PRRT                   = $_POST["PRRT"];
    $PRRTDate               = $_POST["PRRTDate"];
    $TypePRRT               = $_POST["TypeofPRRT"];
    $NumCycles              = $_POST["NumberofCycles"];
    $PRRTDose               = $_POST["PRRTDose"];
    $SSAs                   = $_POST["SSAs"];
    $SSAsDate               = $_POST["SSAsDate"];
    $SSAsType               = $_POST["SSAsType"];
    $SSAsAmount             = $_POST["SSAsAmount"];
    $Everolimus             = $_POST["Everolimus"];
    $EverolimusDate         = $_POST["EverolimusDate"];
    $Sunitnib               = $_POST["Sunitnib"];
    $SunitnibDate           = $_POST["SunitnibDate"];
    $Bevacizumab            = $_POST["Bevacizumab"];
    $BevacizumabDate        = $_POST["BevacizumabDate"];
    $Chemotherapy           = $_POST["Chemotherapy"];
    $ChemoDate              = $_POST["ChemoDate"];
	if (isset($_POST["ChemoTreatment"])) {
    $ChemoTreatment         = implode(",", $_POST["ChemoTreatment"]);
	}
    
    
    $list = array(
        array(
            $lastname,
            $firstname,
            $middlename,
            $age,
            $email,
            $race,
            $gender,
            $homePhone,
            $cellPhone,
            $workPhone,
            $dateofdiagnosis,
            $DiagnosisModality,
            $signs,
            $symptoms,
            $FamilyHistory,
            $dateofbloodresults,
            $Hematology,
            $Hepatic,
            $Renal,
            $Biomarkers,
            $AbnormNET,
            $AbnormCGA,
            $AbnormPancrea,
            $AbnormSerotonin,
            $AbnormU5IAA,
            $AbnormBiomarker,
            $PrimaryLocation,
            $cancerStatus,
            $cancerStage,
            $SecondaryLocation,
            $Histopathology,
            $HistopathologyLung,
            $HistopathologyGEPNET,
            $HistopathologyKi67,
            $HistopathologyMitosesLUNG,
            $HistopathologyMitosesGEPNETS,
            $Ostreoscan,
            $OstreoscanDate,
            $OstreoscanPosNeg,
            $OstreoscanArea,
            $OstreoscanLiverLobe,
            $OstreoscanLesions,
            $OstreoscanUptake,
            $CTScan,
            $CTScanDate,
            $CTScanPosNeg,
            $CTScanArea,
            $CTScanLiverLobe,
            $CTScanLesions,
            $CTScanLesions,
            $CTScanSizeofMeta,
            $MRIScan,
            $MRIScanDate,
            $MRIScanPosNeg,
            $MRIScanArea,
            $MRIScanLiverLobe,
            $MRIScanLesions,
            $MRIScanSizeofMeta,
            $FDGScan,
            $FDGScanDate,
            $FDGScanPosNeg,
            $FDGScanArea,
            $FDGScanLiverLobe,
            $FDGScanLesions,
            $FDGScanL1,
            $FDGScanL2,
            $FDGScanL3,
            $FDGScanL4,
            $FDGScanL5,
            $IstopeImaging,
            $IstopeImageDate,
            $IsotopeConjugad,
            $IsotopeL1,
            $IsotopeL2,
            $IsotopeL3,
            $IsotopeL4,
            $IsotopeL5,
            $PrimarySurgery,
            $PrimarySurgeryDate,
            $PrimaryGISurgery,
            $PrimaryLungSurgery,
            $MetastasesSurgery,
            $MetastasesSurgeryDate,
            $MetastasesLiverSurgery,
            $MetastasesLungSurgery,
            $Staging,
            $StagingDate,
            $StagingNum,
            $Interventions,
            $InterventionDate,
            $TypeInter,
            $PRRT,
            $PRRTDate,
            $TypePRRT,
            $NumCycles,
            $PRRTDose,
            $SSasDate,
            $SSAsType,
            $SSAsAmount,
            $Everolimus,
            $EverolimusDate,
            $Sunitnib,
            $SunitnibDate,
            $Bevacizumab,
            $BevacizumabDate,
            $Chemotherapy,
            $ChemoDate,
            $ChemoTreatment,
            "\n"
        )
    );
    
    if (empty($errors)) {
        $filename = date("Y-m-d-g-i-a") . "-" . $lastname . "-" . $firstname . ".csv";
        
        $fp = fopen($filename, 'a+');
        
        foreach ($list as $fields) {
            fputcsv($fp, $fields);
        }
        fclose($fp);
        
        //header('Location: http://www.wrenlaboratories.com/');
		header("refresh:5; url=http://www.wrenlaboratories.com/"); 
		exit("Thank you for all your information, it is greatly appreciated and will help out our research.");
    }
}
?> 

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tumor Patient History Form</title>
<style>
.error {color: #FF0000;}
</style>
</head>
<body class="patients">
<a name="top" id="top"></a>
<div id="container">
  <div id="header">
    <div id="title"><font size=18> Neuroendocrine Tumor Patients</font>
      <!-- end #title -->
    </div>

    <!-- end #header -->
  </div>
	<h1><a name="Wren Patient Form" id="Wren Patient Form"></a>NEW PATIENT HISTORY FORM </h1>
	<p>* Denotes required</p>
    <form method="post" name="WrenForm" id="WrenForm">
      <input name="subject" type="hidden" value="New Patient History Form" 	/>
      <p>Name (Last): *
        <input name="lastname" type="text" id="lastname" size="15" value="<?php echo $lastname;?>" />
	<?php
		if($errors['lastname']){
		    echo "<span class='error'>".$errors['lastname']."</span>";
		}
	?>
         (First): * 
        <input name="firstname" type="text" id="firstname" size="15"  value="<?php echo $firstname;?>" />
	<?php
		if($errors['firstname']){
		    echo "<span class='error'>".$errors['firstname']."</span>";
		}
	?>
         (Middle):
        <input name="middlename" type="text" id="middlename" size="15" value="<?php echo $middlename;?>" />
         
        
        Age: * 
        <input name="age" type="text" id="age" size="2" value="<?php echo $age;?>"  />
	<?php
		if($errors['age']){
		    echo "<span class='error'>".$errors['age']."</span>";
		}
	?>
         
      </p>
      <p>
Email: * 
        <input name="email" type="text" id="email" size="40"  value="<?php echo $email;?>" />
	<?php
		if($errors['email']){
		    echo "<span class='error'>".$errors['email']."</span>";
		}
	?>
		  

Race:
 	<select name="race">
	  <option <?php if ($race == '' ) echo 'selected' ; ?> value=""></option>
	  <option <?php if ($race == 'Caucsian' ) echo 'selected' ; ?> value="Caucsian">Caucasian</option>
	  <option <?php if ($race == 'Black' ) echo 'selected' ; ?> value="Black">Black</option>
	  <option <?php if ($race == 'Hispanic' ) echo 'selected' ; ?> value="Hispanic">Hispanic/Latino</option>
	  <option <?php if ($race == 'Asian' ) echo 'selected' ; ?>  value="Asian">Asian</option>
	  <option <?php if ($race == 'OtherRace' ) echo 'selected' ; ?>  value="OtherRace">Other</option>
	 </select>
           
		
Gender: * 
 	<select name="gender">
	  <option <?php if ($gender == '' ) echo 'selected' ; ?> value=""></option>
	  <option <?php if ($gender == 'Male' ) echo 'selected' ; ?> value="Male">Male</option>
	  <option <?php if ($gender == 'Female' ) echo 'selected' ; ?> value="Female">Female</option>
	 </select>
	<?php
	    if($errors['gender']){
		    echo "<span class='error'>".$errors['gender']."</span>";
		}
	?>
           
      </p>
      <p>Home Phone:
        <input name="homePhone" type="text" id="homePhone" size="14" value="<?php echo $homePhone;?>" />
           Cell Phone: 
        <input name="cellPhone" type="text" id="cellPhone" size="14" value="<?php echo $cellPhone;?>" />
           Work Phone: 
        <input name="workPhone" type="text" id="workPhone" size="14" value="<?php echo $workPhone;?>" />
      </p>
      <p><strong><u><h2>Cancer Information:</h2></u></strong></p>
<p>
        Diagnosis Date:  
        <input name="dod" type="text" id="dod" size="8"  value="<?php echo $dod;?>" />  <font size="2">(ex. 10/26/1985)</font>
</p>
<p>Diagnosis Modality:<br>
        <input name="DiagnosisModality[]" type="checkbox" id="DiagnosisModality[]" value=" Endoscopy" />
        Endoscopy    
        <input name="DiagnosisModality[]" type="checkbox" id="DiagnosisModality[]" value=" Imaging" />
        Imaging    
        <input name="DiagnosisModality[]" type="checkbox" id="DiagnosisModality[]" value=" Histology" />
        Histology    
        <input name="DiagnosisModality[]" type="checkbox" id="DiagnosisModality[]" value=" Biomaker" />
        Biomaker    
</p>
<p>Signs:<br>
        <input name="signs[]" type="checkbox" id="signs[]" value="Weight Gain" />
        Weight Gain    
		<input name="signs[]" type="checkbox" id="signs[]" value="Weight Loss" />
        Weight Loss    
        <input name="signs[]" type="checkbox" id="signs[]" value=" Lump" />
        Lump    
        <input name="signs[]" type="checkbox" id="signs[]" value=" Anemia" />
        Anemia    
        <input name="signs[]" type="checkbox" id="signs[]" value=" Flushing" />
        Flushing    
</p>
<p>Symptoms:<br>
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Flush" />
        Flush    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Sweat" />
        Sweat    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Diarrhea" />
        Diarrhea    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Pain" />
        Pain    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Palpitation" />
        Palpitation    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Constipation" />
        Constipation    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Glycemia" />
        Glycemia    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" OtherSym" />
        Other    
</p>
<p> Family History Of NETs: <br>
      <input type="radio" name="FamilyHistory" id="FamilyHistory" value="Yes Father" />
      Yes Father's Side    
       
      <input type="radio" name="FamilyHistory" id="FamilyHistory" value="Yes Mother" />
      Yes Mother's Side    
       
      <input type="radio" name="FamilyHistory" id="FamilyHistory" value="No" />
      No    </p>
<p><h2><strong><u>Blood Results: </u></strong></h2> Date of Results:
        <input name="dobr" type="text" id="dobr" size="8" />     <font size="2">(ex. 10/26/1985)</font>
      </p>
<p>Abnormal Hematology:<br>
        <input name="Hematology[]" type="checkbox" id="Hematology[]" value=" Hb" />
        Hb    
        <input name="Hematology[]" type="checkbox" id="Hematology[]" value=" WCC" />
        WCC    
        <input name="Hemotology[]" type="checkbox" id="Hematology[]" value=" Platelets" />
        Platelets    </p>
<p>Abnormal Hepatic Function:<br>
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" Bilirubin" />
        Bilirubin    
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" ALK P" />
        ALK P    
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" ALT" />
        ALT    
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" ATT" />
        ATT    
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" Albumin" />
        Albumin    </p>
<p>Abnormal Renal Function:<br>
        <input name="Renal[]" type="checkbox" id="Renal[]" value=" Urea" />
        Urea    
        <input name="Renal[]" type="checkbox" id="Renal[]" value=" Creatinine" />
        Creatinine    
</p>
<p>Biomarkers:<br>
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" NETest" />
        NETest    
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" Chromogranin A" />
        Chromogranin A    
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" Pancreastatin" />
        Pancreastatin    
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" Serotonin" />
        Serotonin    
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" U-5HIAA" />
        U-5HIAA    
        <input name="Biomarker[]" type="text" id="Biomarker[]" size="10"/>
        Other    
</p>
<p> Abnormal Elevated Biomarkers:<br>
Yes  : <input type="radio" name="AbnormalElevatedNETest" id="AbnormalElevatedNETest" value="Yes" />                    
	<input type="radio" name="AbnormalElevatedCgA" id="AbnormalElevatedCgA" value="Yes" />                            
	<input type="radio" name="AbnormalElevatedPancreastatin" id="AbnormalElevatedPancreastatin" value="Yes" />                        
	<input type="radio" name="AbnormalElevatedSerotonin" id="AbnormalElevatedSerotonin" value="Yes" />                     
	<input type="radio" name="AbnormalElevatedU5HIAA" id="AbnormalElevatedU5HIAA" value="Yes" />                    
	<input type="radio" name="AbnormalElevatedOtherBiomarker" id="AbnormalElevatedOtherBiomarker" value="Yes" />
	<br> 
No   : <input type="radio" name="AbnormalElevatedNETest" id="AbnormalElevatedNETest" value="No" />                    
	<input type="radio" name="AbnormalElevatedCgA" id="AbnormalElevatedCgA" value="No" />                            
	<input type="radio" name="AbnormalElevatedPancreastatin" id="AbnormalElevatedPancreastatin" value="No" />                        
	<input type="radio" name="AbnormalElevatedSerotonin" id="AbnormalElevatedSerotonin" value="No" />                     
	<input type="radio" name="AbnormalElevatedU-5HIAA" id="AbnormalElevatedU-5HIAA" value="No" />                    
	<input type="radio" name="AbnormalElevatedOtherBiomarker" id="AbnormalElevatedBiomarker" value="No" />
<br>      NETest                 CgA                      Pancreastatin         Serotonin              U-5IAA           Other Biomarkers
	</p>
<p><h2><strong><u>Tumor Location:</u></strong></h2>
Primary Location: 
 	<select name="PrimaryLocation">
	  <option value="SmallBowel">Small Bowel</option>
	  <option value="Pancreas">Pancreas</option>
	  <option value="Rectum">Rectum</option>
	  <option value="Gastric">Gastric</option>
	  <option value="Appendix">Appendix</option>
	  <option value="Colon">Colon</option>
	  <option value="Duodenum">Duodenum</option>
	  <option value="Lung">Lung</option>
	  <option value="Other">Other</option>
	 </select>
           
      Current Status:
 	<select name="cancerStatus">
	  <option value="Pre-Surgery">Pre-Surgery</option>
	  <option value="Post Surgery">Post Surgery</option>
	  <option value="Recurrence">Recurrence</option>
	 </select>
    
      Current Stage:
 	<select name="cancerStage">
	  <option value="0">Stage 0</option>
	  <option value="1">Stage 1</option>
	  <option value="2">Stage 2</option>
	  <option value="3">Stage 3</option>
	  <option value="4">Stage 4</option>
     </select>
<br><br>
Metastasis (Second Location):
 	<select name="SecondaryLocation">
	  <option value="No Secondary">No Secondary Tumor</option>
	  <option value="Liver">Liver</option>
	  <option value="LymphNodes">Lymph Nodes</option>
	  <option value="Peritoneum">Peritoneum</option>
	  <option value="Lung">Lung</option>
	  <option value="Bone">Bone</option>
	  <option value="Brain">Brain</option>
	  <option value="Other">Other</option>
	  <option value="Multiple">Multiple Locations</option>
     </select>
</p>
<p><h2><strong><u>Histopathology:</u></strong></h2>
      <input type="radio" name="Histopathology" id="Histopathology" value="Yes" />
      Yes    
       
      <input type="radio" name="Histopathology" id="Histopathology" value="No" />
      No                          
	  Date of Hisopathology:  <input name="dobr" type="text" id="dobr" size="8" />     <font size="2">(ex. 10/26/1985)</font>
<br><br><font size="4"><u>Lungs:</u></font><br>
     <input type="radio" name="HistopathologyLung" id="HistopathologyLung" value="Typical Carinoid" />
      Typical Carinoid    
       
      <input type="radio" name="HistopathologyLung" id="HistopathologyLung" value="Atypical Carcinoid" />
      Atypical Carcinoid
      <input type="radio" name="HistopathologyLung" id="HistopathologyLung" value="Large Cell NEC" />
      Large Cell NEC
      <input type="radio" name="HistopathologyLung" id="HistopathologyLung" value="Small Cell NEC" />
      Small Cell NEC
<br><br><font size="4"><u>GEP-NET:</u></font><br>
     <input type="radio" name="HistopathologyGEPNET" id="HistopathologyGEPNET" value="Well Differentiated" />
      Well Differentiated 
     <input type="radio" name="HistopathologyGEPNET" id="HistopathologyGEPNET" value="Moderately Differentiated" />
      Moderately Differentiated 
     <input type="radio" name="HistopathologyGEPNET" id="HistopathologyGEPNET" value="Poorly Differentiated" />
      Poorly Differentiated 
<br><br><font size="4"><u>Ki-67:</u></font><br>
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="< 2%" />
      < 2% 
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="2-5%" />
      2-5% 
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="6-10%" />
      6-10% 
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="11-20%" />
     11-20% 
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="> 20%" />
      > 20% 
<br><br><font size="4"><u>Mitoses (Lung):</u></font><br>
     <input type="radio" name="HistopathologyMitoses(Lung)" id="HistopathologyMitoses(Lung)" value="< 3 HPF" />
      < 3 HPF 
     <input type="radio" name="HistopathologyMitoses(Lung)" id="HistopathologyMitoses(Lung)" value="4-10 HPF" />
      4-10 HPF 
     <input type="radio" name="HistopathologyMitoses(Lung)" id="HistopathologyMitoses(Lung)" value="> 10 HPF" />
      > 10 HPF 
<br>No Necrosis                                   Necrosis
<br><br><font size="4"><u>Mitoses (GEP-NETs):</u></font><br>
     <input type="radio" name="HistopathologyMitoses(GEP-NETs)" id="HistopathologyMitoses(GEP-NETs)" value="< 2 HPF" />
      < 2 /10HPF 
     <input type="radio" name="HistopathologyMitoses(GEP-NETs)" id="Histopathology Mitoses(GEP-NETs)" value="2-20 HPF" />
      2-20HPF 
     <input type="radio" name="HistopathologyMitoses(GEP-NETs)" id="HistopathologyMitoses(GEP-NETs)" value="> 20 HPF" />
      > 20 HPF 
</p>
<p><h2><strong><u>Imaging:</u></strong></h2>
<h4><u>Ostreoscan</u></h4>
     <input type="radio" name="Ostreoscan" id="Ostreoscan" value="Yes" />      Yes     
      <input type="radio" name="Ostreoscan" id="Ostreoscan" value="No" />
      No                              Date of Scan:
	  <input name="OstreoscanDate" type="text" id="OstreoscanDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
Was your Osetreoscan results Positive or Negative?<br>
     <input type="radio" name="Ostreoscan+/-" id="Ostreoscan+/-" value="Positive" />
      Positive    
       
      <input type="radio" name="Ostreoscan+/-" id="Ostreoscan+/-" value="Negative" />
      Negative<br><br>
What area did you have Scanned?<br>
	        <input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Primary" /> Primary  
			<input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Lymph Node" /> Lymph Node  
			<input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Peritoneum" /> Peritoneum  
			<input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Bone" /> Bone  
			<input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Liver" /> Liver   
			Other:  <input name="OstreoscanArea" type="text" id="OstreoscanArea" size="10" /> 
<br><br>If you had the liver scanned what area showed activity?<br>
			<input type="radio" name="OstreoscanLiverLobe" id="OstreoscanLiverLobe" value="Left" /> Left	
			<input type="radio" name="OstreoscanLiverLobe" id="OstreoscanLiverLobe" value="Right" /> Right
			<input type="radio" name="OstreoscanLiverLobe" id="OstreoscanLiverLobe" value="Both" /> Both<br><br>
			<input type="radio" name="OstreoscanLesions" id="OstreoscanLesions" value="<2" />	<2
			<input type="radio" name="OstreoscanLesions" id="OstreoscanLesions" value="2-5" /> 2-5
			<input type="radio" name="OstreoscanLesions" id="OstreoscanLesions" value="5-10" /> 5-10
			<input type="radio" name="OstreoscanLesions" id="OstreoscanLesions" value=">10" /> >10              
			<input type="radio" name="OstreoscanUptake" id="OstreoscanUptake" value="1" /> 1
			<input type="radio" name="OstreoscanUptake" id="OstreoscanUptake" value="2" /> 2
			<input type="radio" name="OstreoscanUptake" id="OstreoscanUptake" value="3" /> 3
			<input type="radio" name="OstreoscanUptake" id="OstreoscanUptake" value="4" /> 4
			<br>            Number of Lesions                           Uptake (Krenning Scale)
			
<h4><u>CT Scan</u></h4>
     <input type="radio" name="CTScan" id="CTScan" value="Yes" />      Yes     
      <input type="radio" name="CTScan" id="CTScan" value="No" />
      No                              Date of Scan:
	  <input name="CTScanDate" type="text" id="CTScanDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
Was your CT Scan results Positive or Negative?<br>
     <input type="radio" name="CTScan+/-" id="CTScan+/-" value="Positive" />
      Positive    
       
      <input type="radio" name="CTScan+/-" id="CTScan+/-" value="Negative" />
      Negative<br><br>
What area did you have Scanned?<br>
	        <input type="radio" name="CTScanArea" id="CTScanArea" value="Primary" /> Primary  
			<input type="radio" name="CTScanArea" id="CTScanArea" value="Lymph Node" /> Lymph Node  
			<input type="radio" name="CTScanArea" id="CTScanArea" value="Peritoneum" /> Peritoneum  
			<input type="radio" name="CTScanArea" id="CTScanArea" value="Bone" /> Bone  
			<input type="radio" name="CTScanArea" id="CTScanArea" value="Liver" /> Liver   
			Other:  <input name="CT Scan Area" type="text" id="CT Scan Area" size="10" /> 
<br><br>If you had the liver scanned what area showed activity?<br>
			<input type="radio" name="CTScanLiverLobe" id="CTScanLiverLobe" value="Left" /> Left	
			<input type="radio" name="CTScanLiverLobe" id="CTScanLiverLobe" value="Right" /> Right
			<input type="radio" name="CTScanLiverLobe" id="CTScanLiverLobe" value="Both" /> Both<br><br>
			<input type="radio" name="CTScanLesions" id="CTScanLesions" value="<2" />	<2
			<input type="radio" name="CTScanLesions" id="CTScanLesions" value="2-5" /> 2-5
			<input type="radio" name="CTScanLesions" id="CTScanLesions" value="5-10" /> 5-10
			<input type="radio" name="CTScanLesions" id="CTScanLesions" value=">10" /> >10              
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value="<1/2" /> <1/2
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value="1" /> 1
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value="1-2" /> 1-2
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value="2-3" /> 2-3
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value=">3" /> >3
			<br>            Number of Lesions                                      Size of Metastases (cm)
			
<h4><u>MRI Scan</u></h4>
     <input type="radio" name="MRIScan" id="MRIScan" value="Yes" />      Yes     
      <input type="radio" name="MRIScan" id="MRIScan" value="No" />
      No                              Date of Scan:
	  <input name="MRIScanDate" type="text" id="MRIScanDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
Was your MRI Scan results Positive or Negative?<br>
     <input type="radio" name="MRIScan+/-" id="MRIScan+/-" value="Positive" />
      Positive    
       
      <input type="radio" name="MRIScan+/-" id="MRIScan+/-" value="Negative" />
      Negative<br><br>
What area did you have Scanned?<br>
	        <input type="radio" name="MRIScanArea" id="MRIScanArea" value="Primary" /> Primary  
			<input type="radio" name="MRIScanArea" id="MRIScanArea" value="Lymph Node" /> Lymph Node  
			<input type="radio" name="MRIScanArea" id="MRIScanArea" value="Peritoneum" /> Peritoneum  
			<input type="radio" name="MRIScanArea" id="MRIScanArea" value="Bone" /> Bone  
			<input type="radio" name="MRIScanArea" id="MRIScanArea" value="Liver" /> Liver   
			Other:  <input name="MRIScanArea" type="text" id="MRIScanArea" size="10" /> 
<br><br>If you had the liver scanned what area showed activity?<br>
			<input type="radio" name="MRIScanLiverLobe" id="MRIScanLiverLobe" value="Left" /> Left	
			<input type="radio" name="MRIScanLiverLobe" id="MRIScanLiverLobe" value="Right" /> Right
			<input type="radio" name="MRIScanLiverLobe" id="MRIScanLiverLobe" value="Both" /> Both<br><br>
			<input type="radio" name="MRIScanLesions" id="MRIScanLesions" value="<2" />	<2
			<input type="radio" name="MRIScanLesions" id="MRIScanLesions" value="2-5" /> 2-5
			<input type="radio" name="MRIScanLesions" id="MRIScanLesions" value="5-10" /> 5-10
			<input type="radio" name="MRIScanLesions" id="MRIScanLesions" value=">10" /> >10              
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value="<1/2" /> <1/2
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value="1" /> 1
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value="1-2" /> 1-2
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value="2-3" /> 2-3
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value=">3" /> >3
			<br>            Number of Lesions                                      Size of Metastases (cm)
<h4><u>FDG Scan</u></h4>
     <input type="radio" name="FDGScan" id="FDGScan" value="Yes" />      Yes     
      <input type="radio" name="FDGScan" id="FDGScan" value="No" />
      No                              Date of Scan:
	  <input name="FDGScanDate" type="text" id="FDGScanDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
Was your FDG Scan results Positive or Negative?<br>
     <input type="radio" name="FDGScan+/-" id="FDGScan+/-" value="Positive" />
      Positive    
       
      <input type="radio" name="FDGScan+/-" id="FDGScan+/-" value="Negative" />
      Negative<br><br>
What area did you have Scanned?<br>
	        <input type="radio" name="FDGScanArea" id="FDGScanArea" value="Primary" /> Primary  
			<input type="radio" name="FDGScanArea" id="FDGScanArea" value="Lymph Node" /> Lymph Node  
			<input type="radio" name="FDGScanArea" id="FDGScanArea" value="Peritoneum" /> Peritoneum  
			<input type="radio" name="FDGScanArea" id="FDGScanArea" value="Bone" /> Bone  
			<input type="radio" name="FDGScanArea" id="FDGScanArea" value="Liver" /> Liver   
			Other:  <input name="FDGScanArea" type="text" id="FDGScanArea" size="10" /> 
<br><br>If you had the liver scanned what area showed activity?<br>
			<input type="radio" name="FDGScanLiverLobe" id="FDGScanLiverLobe" value="Left" /> Left	
			<input type="radio" name="FDGScanLiverLobe" id="FDGScanLiverLobe" value="Right" /> Right
			<input type="radio" name="FDGScanLiverLobe" id="FDGScanLiverLobe" value="Both" /> Both<br><br>
			<input type="radio" name="FDGScanLesions" id="FDGScanLesions" value="<2" />	<2
			<input type="radio" name="FDGScanLesions" id="FDGScanLesions" value="2-5" /> 2-5
			<input type="radio" name="FDGScanLesions" id="FDGScanLesions" value="5-10" /> 5-10
			<input type="radio" name="FDGScanLesions" id="FDGScanLesions" value=">10" /> >10              
			
			L1: <input name="FDGScanL1SUVmax" type="text" id="FDGScanL1SUVmax" size="1" />
			L2: <input name="FDGScanL2SUVmax" type="text" id="FDGScanL2SUVmax" size="1" />
			L3: <input name="FDGScanL3SUVmax" type="text" id="FDGScanL3SUVmax" size="1" />
			L4: <input name="FDGScanL4SUVmax" type="text" id="FDGScanL4SUVmax" size="1" />
			L5: <input name="FDGScanL5SUVmax" type="text" id="FDGScanL5SUVmax" size="1" /> KBq/ml 
			<br>            Number of Lesions                                              SUVmax (<font size="2">Kilobecquerel/ per Millileter)</font>
			<h4><u>Isotope Imaging</u></h4>
     <input type="radio" name="IsotopeImaging" id="IsotopeImaging" value="Yes" />      Yes     
      <input type="radio" name="IsotopeImaging" id="IsotopeImaging" value="No" />
      No                              Date of Scan:
	  <input name="IsotopeImageDate" type="text" id="IsotopeImageDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
      Type of Tracer:<br>
	  <input name="IsotopeTracer[]" type="checkbox" id="IsotopeTracer[]" value="Ga" /> Ga
	  <input name="IsotopeTracer[]" type="checkbox" id="IsotopeTracer[]" value="Fluro-DOPA" /> Fluro-DOPA
	  <input name="IsotopeTracer[]" type="checkbox" id="IsotopeTracer[]" value="C-HTP" /> C-HTP
	  <input name="IsotopeTracer[]" type="checkbox" id="IsotopeTracer[]" value="Tc-OCT" /> Tc-OCT   
	  Other:  <input name="IsotopeTracer[]" type="text" id="IsotopeTracer[]" size="10" />  <br><br>
	  Did the Tracer Work?<br>
	  <input type="radio" name="IsotopeTracerWorking" id="IsotopeTracerWorking" value="Yes" />      Yes     
      <input type="radio" name="IsotopeTracerWorking" id="IsotopeTracerWorking" value="No" /> No<br><br>
	  Type of Conjugand:<br>
	  <input name="IsotopeConjugand[]" type="checkbox" id="IsotopeConjugand[]" value="TATE" /> TATE
	  <input name="IsotopeConjugand[]" type="checkbox" id="IsotopeConjugand[]" value="TOC" /> TOC
	  <input name="IsotopeConjugand[]" type="checkbox" id="IsotopeConjugand[]" value="NOC" /> NOC<br><br>
	  SUVmax:<br>
	  			Lesion 1: <input name="IsotopeL1SUVmax" type="text" id="IsotopeL1SUVmax" size="1" /> KBq/ml<br>
			Lesion 2: <input name="IsotopeL2SUVmax" type="text" id="IsotopeL2SUVmax" size="1" /> KBq/ml<br>
			Lesion 3: <input name="IsotopeL3SUVmax" type="text" id="IsotopeL3SUVmax" size="1" /> KBq/ml<br>
			Lesion 4: <input name="IsotopeL4SUVmax" type="text" id="IsotopeL4SUVmax" size="1" /> KBq/ml<br>
			Lesion 5: <input name="IsotopeL5SUVmax" type="text" id="IsotopeL5SUVmax" size="1" /> KBq/ml
</p>
<p>
<h2><strong><u>Surgery:</u></strong></h2>
<h4><u>Primary:</u></h4>
     <input type="radio" name="PrimarySurgery" id="PrimarySurgery" value="Yes" /> Yes     
      <input type="radio" name="PrimarySurgery" id="PrimarySurgery" value="No" /> No
	                           Date of Surgery:
	  <input name="PrimarySurgeryDate" type="text" id="PrimarySurgeryDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
<u>GI Tract</u><br>
	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Small Bowel Resection" />    Small Bowel Resection     
	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Right Hemicolectomy" />   Right Hemicolectomy     
	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Whipple Resection" />    Whipple Resection    
	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Enucleation" />    Enucleation    
 	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Tail Resection" />    Tail Resection     
	  Other:  <input name="PrmaryGITractSurgery" type="text" id="PrimaryGITractSurgery" size="10" /><br><br>
	  <u>Lung</u><br>
	  <input type="radio" name="PrimaryLungSurgery" id="PrimaryLungSurgery" value="Lobectomy Resection" />   Lobectomy Resection     
	  <input type="radio" name="PrimaryLungSurgery" id="PrimaryLungSurgery" value="Sleeve Resection" />   Sleeve Resection     
	  <br><br><h4><u>Metastases:</u></h4>
	  <input type="radio" name="MetastasesSurgery" id="MetastasesSurgery" value="Yes" /> Yes     
      <input type="radio" name="MetastasesSurgery" id="MetastasesSurgery" value="No" /> No
	                            Date of Surgery:
	  <input name="MetastasesSurgeryDate" type="text" id="MetastasesSurgeryDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
<u>Liver</u><br>
	  <input type="radio" name="MetastasesLiverSurgery" id="MetastasesLiver Surgery" value="Right Lobectomy" />    Right Lobectomy     
	  <input type="radio" name="MetastasesLiverSurgery" id="MetastasesLiver Surgery" value="Left Lobectomy" />    Left Lobectomy     
	  <input type="radio" name="MetastasesLiverSurgery" id="MetastasesLiver Surgery" value="Wedge Resection" />    Wedge Resection     
	  <input type="radio" name="MetastasesLiverSurgery" id="MetastasesLiver Surgery" value="Cherry Picking" />    Cherry Picking     
	  	  Other:  <input name="MetastasesLiverSurgery" type="text" id="MetastasesLiverSurgery" size="10" /><br><br>
<u> Lung</u><br>
	  <input type="radio" name="MetastasesLungSurgery" id="MetastasesLungSurgery" value="Right Lobectomy" />    Right Lobectomy     
	  <input type="radio" name="MetastasesLungSurgery" id="MetastasesLungSurgery" value="Left Lobectomy" />    Left Lobectomy    
	  <input type="radio" name="MetastasesLungSurgery" id="MetastasesLungSurgery" value="Wedge Resection" />    Wedge Resection    
	  Other:  <input name="MetastasesLungSurgery" type="text" id="MetastasesLungSurgery" size="10" /><br>
		  <br><h4><u>Staging:</u></h4>
	  <input type="radio" name="Staging" id="Staging" value="Yes" /> Yes     
      <input type="radio" name="Staging" id="Staging" value="No" /> No
	                           Date of Surgery:
	  <input name="StagingDate" type="text" id="StagingDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
	  Primary Tumor(T)       Regional Lymph Nodes (N)       Distant Metastasisx (M)<br>
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="T1" />      
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="T2" />    
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="T3" />    
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="T4" />                      
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="N0" />    
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="N1" />                            
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="M0" />    
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="M1" />    
	  <br> T1    T2    T3    T4                     N0    N1                         M0   M1
	  </p>

<p><h2><strong><u>Interventions:</u></strong></h2>
	  <input type="radio" name="Interventions" id="Interventions" value="Yes" /> Yes     
      <input type="radio" name="Interventions" id="Interventions" value="No" /> No
	                            Date of Intervention:
	  <input name="Intervention Date" type="text" id="Intervention Date" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="Bland Embolization"> Bland Embolization<br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="Chemo Embolization"> Chemo Embolization<br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="SIRT"> SIRT<br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="Thera Spheres"> Thera Spheres<br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="RFA"> RFA<br>
 Other:  <input name="TypeofInterventions" type="text" id="TypeofInterventions" size="10" /><br>
	  <h4><u>PRRT:</u></h4>
	  	  <input type="radio" name="PRRT" id="PRRT" value="Yes" /> Yes     
      <input type="radio" name="PRRT" id="PRRT" value="No" /> No
	                            Date of PRRT:
	  <input name="PRRTDate" type="text" id="PRRTDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
	  <br>Drug for intervention:<br><input type="checkbox" name="TypeofPRRT[]" id="TypeofPRRT[]" value="Lutetium">Lutetium
	  <input type="checkbox" name="TypeofPRRT[]" id="TypeofPRRT[]" value="Yttrium">Yttrium<br><br>
	 Number of Cycles: 
 	<select name="Number of Cylces">
	  <option value="0">No PRRT</option>
	  <option value="1">1 Cycle</option>
	  <option value="2">2 Cycles</option>
	  <option value="3">3 Cycles</option>
	  <option value="4">4 Cycles</option>
	  <option value="5">5 Cycles</option>
	 </select><br><br>
	 Dosage:
	 <input name="PRRT Dose" type="text" id="PRRT Dose" size="8" />MBq/per cycle <font size="2">(Megabecquerel per cycle)</font>
</p>

<p><h2><strong><u>Medication:</u></strong></h2>
<h4><u>SSAs:</u></h4>
<input type="radio" name="SSAs" id="SSAs" value="Yes" />Yes   
<input type="radio" name="SSAs" id="SSAs" value="No" />No         
Date:   <input name="SSAsDate" type="text" id="SSAsDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
SSAs given medication:<br>
<input type="radio" name="SSAsType" id="SSAsType" value="Sandostatin" />Sandostatin   
<input type="radio" name="SSAsType" id="SSAsType" value="Lanreotide" />Lanreotide   <br><br>
Amount of SSAs medication taken daily:<br>
<input type="radio" name="SSAsAmount" id="SSAsAmount" value="10mg" />10mg   
<input type="radio" name="SSAsAmount" id="SSAsAmount" value="20mg" />20mg   
<input type="radio" name="SSAsAmount" id="SSAsAmount" value="30mg" />30mg   
<input type="radio" name="SSAsAmount" id="SSAsAmount" value="40mg" />40mg   
Other Amounts:  <input name="SSAsAmount" type="text" id="SSAsAmount" size="1" />mg<br><br>
Duration of SSA Medication:<br><input name="SSAs Durration (Months) " type="text" id="SSAs Durration (Months)" size="2" />    Months <font size="2">(ex. 34 is 2 years and 10 months)</font>
<br><h4><u>Everolimus:</u></h4>
<input type="radio" name="Everolimus" id="Everolimus" value="Yes" />Yes   
<input type="radio" name="Everolimus" id="Everolimus" value="No" />No   
      Date:   <input name="EverolimusDate" type="text" id="EverolimusDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
<h4><u>Sunitnib:</u></h4>
<input type="radio" name="Sunitnib" id="Sunitnib" value="Yes" />Yes   
<input type="radio" name="Sunitnib" id="Sunitnib" value="No" />No   
      Date:   <input name="SunitnibDate" type="text" id="SunitnibDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
<h4><u>Bevacizumab:</u></h4>
<input type="radio" name="Bevacizumab" id="Bevacizumab" value="Yes" />Yes   
<input type="radio" name="Bevacizumab" id="Bevacizumab" value="No" />No   
      Date:   <input name="BevacizumabDate" type="text" id="BevacizumabDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
<h4><u>Chemotherapy:</u></h4>
<input type="radio" name="Chemotherapy" id="Chemotherapy" value="Yes" />Yes   
<input type="radio" name="Chemotherapy" id="Chemotherapy" value="No" />No   
      Date:   <input name="ChemoDate" type="text" id="ChemoDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
        <br>Type of Chemotherapy:<br><input name="ChemoTreatment[]" type="checkbox" id="ChemoTreatment[]" value="Temozolomide" />
        Temozolomide    
        <input name="ChemoTreatment[]" type="checkbox" id="ChemoTreatment[]" value="5-FU" />
        5-FU    
        <input name="ChemoTreatment[]" type="checkbox" id="ChemoTreatment[]" value="Streptozotozin" />
        Streptozotozin    
        <input name="ChemoTreatment[]" type="checkbox" id="ChemoTreatment[]" value="Cisplatin" />
        Cisplatin    
        Other:  <input name="ChemoTreatment[]" type="text" id="ChemoTreatment[]" size="8" />
</p>
<input type="submit" name="submit" id="submit" value="Submit" />
<input type="reset" name="clear" value="Clear">
      </p>
    </form>
    <!-- end #mainContent -->
  </div>
  <div id="footer">
   <!-- end #footer -->
  </div>
  <!-- end #container -->
</div>
</body>
</html>

OP, you have a seriously bad naming convention, which is to say you don't have one. Your names are ALL OVER THE PLACE with upper and lowercase. Your best bet is to use all lowercase_with_underscores_separating_words. camelCase is the other accepted naming convention althoughIthinkiItIsMuchharderToread 

 

Windows servers are stupid when it comes to case. It doesnt care what it is. It thinks it's all the same, but Linux does not.

 

 

DO NOT USE $_SERVER['PHP_SELF']!   It is vulnerable to SQL Injection. 

 

 

Use $_SERVER['SCRIPT_NAME'] instead.

 

 

Not sure if OP did it or @QuickOldCar,

Why are you setting these like this: $lastname = ''; ??

 

If you get to the else, it is ALREADY empty. That's why you are at the ELSE

 

And why are you trimming the same POST var TWICE?

Edited by benanamen

 

And why are you trimming the same POST var TWICE?

first trim is just checking, the next actually using it

 

 

Why are you setting these like this: $lastname = ''; ??

Is defining variable as blank to use in the form, otherwise would never be defined, is not in that huge list above.

 

 

DO NOT USE $_SERVER['PHP_SELF']!   It is vulnerable to SQL Injection.

Action removed in the posted form

first trim is just checking, the next actually using it

Checking what? trim isnt any kind of check, it strips leading and trailing spaces

 

Is defining variable as blank to use in the form, otherwise would never be defined, is not in that huge list above.

 

It's STILL not defined. It needs to be outside of $_POST

 

 

No lets look at the code here:

 

if (isset($_POST["lastname"]) && trim($_POST["lastname"]) != '') {
        $lastname = trim($_POST["lastname"]);
    } else {
        $lastname           = '';
        $errors['lastname'] = "Last Name is required";
    }

$_POST["lastname"] is going to be set no matter what so what is the point of checking to see if it is? What you want to do is check if it is EMPTY. Suffice it to say, doing two trims is pointless and does nothing.

 

So how should it be? That whole bunch of code above could be written as:

$lastname = !empty($_POST["lastname"]) ? trim($_POST["lastname"]) : $errors['lastname'] = "Last Name is required";
Although $lastname would also be set to the error message if the field is empty, the correct $errors code will stop everything before it matters. I would actually do all the error checking much different but I am not up to getting into it right now, but there is a better way. This is just a quick example.
 
 
Now, all of this everywhere is just ridiculous. There must be a thousand of those in the page. CSS is our friend here.

                  

 

 

Now we come to another problem

	<input name="lastname" type="text" id="lastname" size="15" value="<?php echo $lastname;?>" />

This is going to give you an undefined index since $lastname is not set until AFTER you $_POST.

 

 

The following is also going to give you undefined index errors as well for the same reason:

		if($errors['lastname']){
		    echo "<span class='error'>".$errors['lastname']."</span>";
		}
Edited by benanamen

You were right about only within post, so added them up top. OP originally had them there although a wrong variable name for one.

That's about all I'm willing to do with it, if you want to see something different be my guest and rewrite it for them.

 

 

Checking what? trim isnt any kind of check, it strips leading and trailing spaces

Of course that's what it does. What don't you get about the trim part? Is part of the checking process...not the actual checking process.

 

 

So how should it be? That whole bunch of code above could be written as:

$lastname = !empty($_POST["lastname"]) ? trim($_POST["lastname"]) : $errors['lastname'] = "Last Name is required";

The OP has no experience, not going to confuse them doing ternary operators or do additional work.

<?php
date_default_timezone_set('UTC');
$errors = array();

$firstname = $lastname = $middlename = $gender = $age = $email =  $race = $homePhone = $cellPhone = $workPhone = $dateofdiagnosis = $FamilyHistory = $dateofbloodresults = $AbnormNET = $AbnormCGA = $AbnormPancrea = $AbnormSerotonin = $AbnormU5IAA = $AbnormOtherBiomarker = $PrimaryLocation = $cancerStatus = $cancerStage = $SecondaryLocation = $Histopathology = $HistopathologyLung = $HistopathologyGEPNET = $HistopathologyKi67 = $HistopathologyMitosesLUNG = $HistopathologyMitosesGEPNETS = $Ostreoscan = $OstreoscanDate = $OstreoscanPosNeg = $OstreoscanArea = $OstreoscanLiverLobe = $OstreoscanLesions = $OstreoscanUptake = $CTScan = $CTScanDate = $CTScanPosNeg = $CTScanArea = $CTScanLiverLobe = $CTScanLesions = $CTScanLesions = $CTScanSizeofMeta = $MRIScan = $MRIScanDate = $MRIScanPosNeg = $MRIScanArea = $MRIScanLiverLobe = $MRIScanLesions = $MRIScanSizeofMeta = $FDGScan = $FDGScanDate = $FDGScanPosNeg = $FDGScanArea = $FDGScanLiverLobe = $FDGScanLesions = $FDGScanL1 = $FDGScanL2 = $FDGScanL3 = $FDGScanL4 = $FDGScanL5 = $IstopeImaging = $IstopeImageDate = $IsotopeConjugad = $IsotopeL1 = $IsotopeL2 = $IsotopeL3 = $IsotopeL4 = $IsotopeL5 = $PrimarySurgery = $PrimarySurgeryDate = $PrimaryGISurgery = $PrimaryLungSurgery = $MetastasesSurgery = $MetastasesSurgeryDate = $MetastasesLiverSurgery = $MetastasesLungSurgery = $Staging = $StagingDate = $StagingNum = $Interventions = $InterventionDate = $TypeInter = $PRRT = $PRRTDate = $TypePRRT = $NumCycles = $PRRTDose = $SSasDate = $SSAsType = $SSAsAmount = $Everolimus = $EverolimusDate = $Sunitnib = $SunitnibDate = $Bevacizumab = $BevacizumabDate = $Chemotherapy = $ChemoDate = "";
$DiagnosisModality = $signs = $symptoms = $Hematology = $Hepatic = $Renal = $Biomarkers = $IsotopeConjugad = $ChemoTreatment = '';

if (isset($_POST["submit"])) {
    
    if (isset($_POST["lastname"]) && trim($_POST["lastname"]) != '') {
        $lastname = trim($_POST["lastname"]);
    } else {
        $errors['lastname'] = "Last Name is required";
    }
    
    if (isset($_POST["firstname"]) && trim($_POST["firstname"]) != '') {
        $firstname = trim($_POST["firstname"]);
    } else {
        $errors['firstname'] = "First Name is required";
    }
    
    if (isset($_POST["middlename"])) {
        $middlename = $_POST["middlename"];
    }
    
    if (isset($_POST["age"]) && ctype_digit(trim($_POST["age"]))) {
        $age = trim($_POST["age"]);
    } else {
        $errors['age'] = "Age is required";
    }
    
    if (isset($_POST["email"]) && filter_var(trim($_POST["email"]), FILTER_VALIDATE_EMAIL)) {
        $email = trim($_POST["email"]);
    } else {
        $errors['email'] = "Email is required";
    }
    
    if (isset($_POST["race"]) && trim($_POST["race"]) != '') {
        $race = trim($_POST["race"]);
    }
    
    if (isset($_POST["gender"]) && trim($_POST["gender"]) != '') {
        $gender = trim($_POST["gender"]);
    } else {
        $errors['gender'] = "Gender is required";
    }
    
    if (isset($_POST["homePhone"]) && trim($_POST["homePhone"]) != '') {
        $homePhone = $_POST["homePhone"];
    }
    
    if (isset($_POST["cellPhone"]) && trim($_POST["cellPhone"]) != '') {
        $cellPhone = $_POST["cellPhone"];
    }
    if (isset($_POST["workPhone"]) && trim($_POST["workPhone"]) != '') {
        $workPhone = $_POST["workPhone"];
    }
    if (isset($_POST["dod"])) {
        $dateofdiagnosis = $_POST["dod"];
    }
    if (isset($_POST["DiagnosisModality"])) {
        $DiagnosisModality = implode(",", $_POST["DiagnosisModality"]);
    }
    if (isset($_POST["signs"])) {
        $signs = implode(",", $_POST["signs"]);
    }
    if (isset($_POST["symptoms"])) {
        $symptoms = implode(",", $_POST["symptoms"]);
    }
    if (isset($_POST["FamilyHistory"])) {
        $FamilyHistory = $_POST["FamilyHistory"];
    }
    if (isset($_POST["dobr"])) {
        $dateofbloodresults = $_POST["dobr"];
    }
    if (isset($_POST["Hematology"])) {
        $Hematology = implode(",", $_POST["Hematology"]);
    }
    if (isset($_POST["Hepatic"])) {
        $Hepatic = implode(",", $_POST["Hepatic"]);
    }
    if (isset($_POST["Renal"])) {
        $Renal = implode(",", $_POST["Renal"]);
    }
    if (isset($_POST["Biomarkers"])) {
        $Biomarkers = implode(",", $_POST["Biomarkers"]);
    }
    if (isset($_POST["AbnormalElevatedNETest"])) {
        $AbnormNET = $_POST["AbnormalElevatedNETest"];
    }
    if (isset($_POST["AbnormalElevatedCgA"])) {
        $AbnormCGA = $_POST["AbnormalElevatedCgA"];
    }
    if (isset($_POST["AbnormalElevatedPancreastatin"])) {
        $AbnormPancrea = $_POST["AbnormalElevatedPancreastatin"];
    }
    if (isset($_POST["AbnormalElevatedSerotonin"])) {
        $AbnormSerotonin = $_POST["AbnormalElevatedSerotonin"];
    }
    if (isset($_POST["AbnormalElevatedU5HIAA"])) {
        $AbnormU5IAA = $_POST["AbnormalElevatedU5HIAA"];
    }
    if (isset($_POST["AbnormalElevatedOtherBiomarker"])) {
        $AbnormOtherBiomarker = $_POST["AbnormalElevatedOtherBiomarker"];
    }
    if (isset($_POST["PrimaryLocation"])) {
        $PrimaryLocation = $_POST["PrimaryLocation"];
    }
    if (isset($_POST["cancerStatus"])) {
        $cancerStatus = $_POST["cancerStatus"];
    }
    if (isset($_POST["cancerStage"])) {
        $cancerStage = $_POST["cancerStage"];
    }
    if (isset($_POST["SecondaryLocation"])) {
        $SecondaryLocation = $_POST["SecondaryLocation"];
    }
    if (isset($_POST["Histopathology"])) {
        $Histopathology = $_POST["Histopathology"];
    }
    if (isset($_POST["HistopathologyLung"])) {
        $HistopathologyLung = $_POST["HistopathologyLung"];
    }
    if (isset($_POST["HistopathologyGEPNET"])) {
        $HistopathologyGEPNET = $_POST["HistopathologyGEPNET"];
    }
    if (isset($_POST["HistopathologyKi67"])) {
        $HistopathologyKi67 = $_POST["HistopathologyKi67"];
    }
    if (isset($_POST["HistopathologyMitoses(Lung)"])) {
        $HistopathologyMitosesLUNG = $_POST["HistopathologyMitoses(Lung)"];
    }
    
    $HistopathologyMitosesGEPNETS = $_POST["HistopathologyMitoses(GEP-NETs)"];
    $Ostreoscan                   = $_POST["Ostreoscan"];
    $OstreoscanDate               = $_POST["OstreoscanDate"];
    $OstreoscanPosNeg             = $_POST["Ostreoscan+/-"];
    $OstreoscanArea               = $_POST["OstreoscanArea"];
    $OstreoscanLiverLobe          = $_POST["OstreoscanLiverLobe"];
    $OstreoscanLesions            = $_POST["OstreoscanLesions"];
    $OstreoscanUptake             = $_POST["OstreoscanUptake"];
    $CTScan                       = $_POST["CTScan"];
    $CTScanDate                   = $_POST["CTScanDate"];
    $CTScanPosNeg                 = $_POST["CTScan+/-"];
    $CTScanArea                   = $_POST["CTScanArea"];
    $CTScanLiverLobe              = $_POST["CTScanLiverLobe"];
    $CTScanLesions                = $_POST["CTScanLesions"];
    $CTScanSizeofMeta             = $_POST["CTScanSizeofMetastases"];
    $MRIScan                      = $_POST["MRIScan"];
    $MRIScanDate                  = $_POST["MRIScanDate"];
    $MRIScanPosNeg                = $_POST["MRIScan+/-"];
    $MRIScanArea                  = $_POST["MRIScanArea"];
    $MRIScanLiverLobe             = $_POST["MRIScanLiverLobe"];
    $MRIScanLesions               = $_POST["MRIScanLesions"];
    $MRIScanSizeofMeta            = $_POST["MRIScanSizeofMetastases"];
    $FDGScan                      = $_POST["FDGScan"];
    $FDGScanDate                  = $_POST["FDGScanDate"];
    $FDGScanPosNeg                = $_POST["FDGScan+/-"];
    $FDGScanArea                  = $_POST["FDGScanArea"];
    $FDGScanLiverLobe             = $_POST["FDGScanLiverLobe"];
    $FDGScanLesions               = $_POST["FDZGScanLesions"];
    $FDGScanL1                    = $_POST["FDGScanL1SUVmax"];
    $FDGScanL2                    = $_POST["FDGScanL2SUVmax"];
    $FDGScanL3                    = $_POST["FDGScanL3SUVmax"];
    $FDGScanL4                    = $_POST["FDGScanL4SUVmax"];
    $FDGScanL5                    = $_POST["FDGScanL5SUVmax"];
    $IstopeImaging                = $_POST["IstopeImaging"];
    $IstopeImageDate              = $_POST["IstopeImageDate"];
    if (isset($_POST["IsotopeTracer"])) {
        $IstopeTracer = implode(",", $_POST["IsotopeTracer"]);
    }
    $IstopeTracerWorking = $_POST["IstopeTracerWorking"];
    if (isset($_POST["IsotopeConjugad"])) {
        $IsotopeConjugad = implode(",", $_POST["IsotopeConjugad"]);
    }
    $IsotopeL1              = $_POST["IsotopeL1SUVmax"];
    $IsotopeL2              = $_POST["IsotopeL2SUVmax"];
    $IsotopeL3              = $_POST["IsotopeL3SUVmax"];
    $IsotopeL4              = $_POST["IsotopeL4SUVmax"];
    $IsotopeL5              = $_POST["IsotopeL5SUVmax"];
    $PrimarySurgery         = $_POST["PrimarySurgery"];
    $PrimarySurgeryDate     = $_POST["PrimarySurgeryDate"];
    $PrimaryGISurgery       = $_POST["PrimaryGITractSurgery"];
    $PrimaryLungSurgery     = $_POST["PrimaryLungSurgery"];
    $MetastasesSurgery      = $_POST["MetastasesSurgery"];
    $MetastasesSurgeryDate  = $_POST["MetastasesSurgeryDate"];
    $MetastasesLiverSurgery = $_POST["MetastasesLiverSurgery"];
    $MetastasesLungSurgery  = $_POST["MetastasesLungSurgery"];
    $Staging                = $_POST["Staging"];
    $StagingDate            = $_POST["StagingDate"];
    $StagingNum             = $_POST["Staging#"];
    $Interventions          = $_POST["Interventions"];
    $InterventionDate       = $_POST["InterventionDate"];
    $TypeInter              = $_POST["TypeofInterventions"];
    $PRRT                   = $_POST["PRRT"];
    $PRRTDate               = $_POST["PRRTDate"];
    $TypePRRT               = $_POST["TypeofPRRT"];
    $NumCycles              = $_POST["NumberofCycles"];
    $PRRTDose               = $_POST["PRRTDose"];
    $SSAs                   = $_POST["SSAs"];
    $SSAsDate               = $_POST["SSAsDate"];
    $SSAsType               = $_POST["SSAsType"];
    $SSAsAmount             = $_POST["SSAsAmount"];
    $Everolimus             = $_POST["Everolimus"];
    $EverolimusDate         = $_POST["EverolimusDate"];
    $Sunitnib               = $_POST["Sunitnib"];
    $SunitnibDate           = $_POST["SunitnibDate"];
    $Bevacizumab            = $_POST["Bevacizumab"];
    $BevacizumabDate        = $_POST["BevacizumabDate"];
    $Chemotherapy           = $_POST["Chemotherapy"];
    $ChemoDate              = $_POST["ChemoDate"];
	if (isset($_POST["ChemoTreatment"])) {
    $ChemoTreatment         = implode(",", $_POST["ChemoTreatment"]);
	}
    
    
    $list = array(
        array(
            $lastname,
            $firstname,
            $middlename,
            $age,
            $email,
            $race,
            $gender,
            $homePhone,
            $cellPhone,
            $workPhone,
            $dateofdiagnosis,
            $DiagnosisModality,
            $signs,
            $symptoms,
            $FamilyHistory,
            $dateofbloodresults,
            $Hematology,
            $Hepatic,
            $Renal,
            $Biomarkers,
            $AbnormNET,
            $AbnormCGA,
            $AbnormPancrea,
            $AbnormSerotonin,
            $AbnormU5IAA,
            $AbnormBiomarker,
            $PrimaryLocation,
            $cancerStatus,
            $cancerStage,
            $SecondaryLocation,
            $Histopathology,
            $HistopathologyLung,
            $HistopathologyGEPNET,
            $HistopathologyKi67,
            $HistopathologyMitosesLUNG,
            $HistopathologyMitosesGEPNETS,
            $Ostreoscan,
            $OstreoscanDate,
            $OstreoscanPosNeg,
            $OstreoscanArea,
            $OstreoscanLiverLobe,
            $OstreoscanLesions,
            $OstreoscanUptake,
            $CTScan,
            $CTScanDate,
            $CTScanPosNeg,
            $CTScanArea,
            $CTScanLiverLobe,
            $CTScanLesions,
            $CTScanLesions,
            $CTScanSizeofMeta,
            $MRIScan,
            $MRIScanDate,
            $MRIScanPosNeg,
            $MRIScanArea,
            $MRIScanLiverLobe,
            $MRIScanLesions,
            $MRIScanSizeofMeta,
            $FDGScan,
            $FDGScanDate,
            $FDGScanPosNeg,
            $FDGScanArea,
            $FDGScanLiverLobe,
            $FDGScanLesions,
            $FDGScanL1,
            $FDGScanL2,
            $FDGScanL3,
            $FDGScanL4,
            $FDGScanL5,
            $IstopeImaging,
            $IstopeImageDate,
            $IsotopeConjugad,
            $IsotopeL1,
            $IsotopeL2,
            $IsotopeL3,
            $IsotopeL4,
            $IsotopeL5,
            $PrimarySurgery,
            $PrimarySurgeryDate,
            $PrimaryGISurgery,
            $PrimaryLungSurgery,
            $MetastasesSurgery,
            $MetastasesSurgeryDate,
            $MetastasesLiverSurgery,
            $MetastasesLungSurgery,
            $Staging,
            $StagingDate,
            $StagingNum,
            $Interventions,
            $InterventionDate,
            $TypeInter,
            $PRRT,
            $PRRTDate,
            $TypePRRT,
            $NumCycles,
            $PRRTDose,
            $SSasDate,
            $SSAsType,
            $SSAsAmount,
            $Everolimus,
            $EverolimusDate,
            $Sunitnib,
            $SunitnibDate,
            $Bevacizumab,
            $BevacizumabDate,
            $Chemotherapy,
            $ChemoDate,
            $ChemoTreatment,
            "\n"
        )
    );
    
    if (empty($errors)) {
        $filename = date("Y-m-d-g-i-a") . "-" . $lastname . "-" . $firstname . ".csv";
        
        $fp = fopen($filename, 'a+');
        
        foreach ($list as $fields) {
            fputcsv($fp, $fields);
        }
        fclose($fp);
        
        //header('Location: http://www.wrenlaboratories.com/');
		header("refresh:5; url=http://www.wrenlaboratories.com/"); 
		exit("Thank you for all your information, it is greatly appreciated and will help out our research.");
    }
}
?> 

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tumor Patient History Form</title>
<style>
.error {color: #FF0000;}
</style>
</head>
<body class="patients">
<a name="top" id="top"></a>
<div id="container">
  <div id="header">
    <div id="title"><font size=18> Neuroendocrine Tumor Patients</font>
      <!-- end #title -->
    </div>

    <!-- end #header -->
  </div>
	<h1><a name="Wren Patient Form" id="Wren Patient Form"></a>NEW PATIENT HISTORY FORM </h1>
	<p>* Denotes required</p>
    <form method="post" name="WrenForm" id="WrenForm">
      <input name="subject" type="hidden" value="New Patient History Form" 	/>
      <p>Name (Last): *
        <input name="lastname" type="text" id="lastname" size="15" value="<?php echo $lastname;?>" />
	<?php
		if($errors['lastname']){
		    echo "<span class='error'>".$errors['lastname']."</span>";
		}
	?>
         (First): * 
        <input name="firstname" type="text" id="firstname" size="15"  value="<?php echo $firstname;?>" />
	<?php
		if($errors['firstname']){
		    echo "<span class='error'>".$errors['firstname']."</span>";
		}
	?>
         (Middle):
        <input name="middlename" type="text" id="middlename" size="15" value="<?php echo $middlename;?>" />
         
        
        Age: * 
        <input name="age" type="text" id="age" size="2" value="<?php echo $age;?>"  />
	<?php
		if($errors['age']){
		    echo "<span class='error'>".$errors['age']."</span>";
		}
	?>
         
      </p>
      <p>
Email: * 
        <input name="email" type="text" id="email" size="40"  value="<?php echo $email;?>" />
	<?php
		if($errors['email']){
		    echo "<span class='error'>".$errors['email']."</span>";
		}
	?>
		  

Race:
 	<select name="race">
	  <option <?php if ($race == '' ) echo 'selected' ; ?> value=""></option>
	  <option <?php if ($race == 'Caucsian' ) echo 'selected' ; ?> value="Caucsian">Caucasian</option>
	  <option <?php if ($race == 'Black' ) echo 'selected' ; ?> value="Black">Black</option>
	  <option <?php if ($race == 'Hispanic' ) echo 'selected' ; ?> value="Hispanic">Hispanic/Latino</option>
	  <option <?php if ($race == 'Asian' ) echo 'selected' ; ?>  value="Asian">Asian</option>
	  <option <?php if ($race == 'OtherRace' ) echo 'selected' ; ?>  value="OtherRace">Other</option>
	 </select>
           
		
Gender: * 
 	<select name="gender">
	  <option <?php if ($gender == '' ) echo 'selected' ; ?> value=""></option>
	  <option <?php if ($gender == 'Male' ) echo 'selected' ; ?> value="Male">Male</option>
	  <option <?php if ($gender == 'Female' ) echo 'selected' ; ?> value="Female">Female</option>
	 </select>
	<?php
	    if($errors['gender']){
		    echo "<span class='error'>".$errors['gender']."</span>";
		}
	?>
           
      </p>
      <p>Home Phone:
        <input name="homePhone" type="text" id="homePhone" size="14" value="<?php echo $homePhone;?>" />
           Cell Phone: 
        <input name="cellPhone" type="text" id="cellPhone" size="14" value="<?php echo $cellPhone;?>" />
           Work Phone: 
        <input name="workPhone" type="text" id="workPhone" size="14" value="<?php echo $workPhone;?>" />
      </p>
      <p><strong><u><h2>Cancer Information:</h2></u></strong></p>
<p>
        Diagnosis Date:  
        <input name="dod" type="text" id="dod" size="8"  value="<?php echo $dod;?>" />  <font size="2">(ex. 10/26/1985)</font>
</p>
<p>Diagnosis Modality:<br>
        <input name="DiagnosisModality[]" type="checkbox" id="DiagnosisModality[]" value=" Endoscopy" />
        Endoscopy    
        <input name="DiagnosisModality[]" type="checkbox" id="DiagnosisModality[]" value=" Imaging" />
        Imaging    
        <input name="DiagnosisModality[]" type="checkbox" id="DiagnosisModality[]" value=" Histology" />
        Histology    
        <input name="DiagnosisModality[]" type="checkbox" id="DiagnosisModality[]" value=" Biomaker" />
        Biomaker    
</p>
<p>Signs:<br>
        <input name="signs[]" type="checkbox" id="signs[]" value="Weight Gain" />
        Weight Gain    
		<input name="signs[]" type="checkbox" id="signs[]" value="Weight Loss" />
        Weight Loss    
        <input name="signs[]" type="checkbox" id="signs[]" value=" Lump" />
        Lump    
        <input name="signs[]" type="checkbox" id="signs[]" value=" Anemia" />
        Anemia    
        <input name="signs[]" type="checkbox" id="signs[]" value=" Flushing" />
        Flushing    
</p>
<p>Symptoms:<br>
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Flush" />
        Flush    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Sweat" />
        Sweat    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Diarrhea" />
        Diarrhea    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Pain" />
        Pain    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Palpitation" />
        Palpitation    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Constipation" />
        Constipation    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" Glycemia" />
        Glycemia    
        <input name="symptoms[]" type="checkbox" id="symptoms[]" value=" OtherSym" />
        Other    
</p>
<p> Family History Of NETs: <br>
      <input type="radio" name="FamilyHistory" id="FamilyHistory" value="Yes Father" />
      Yes Father's Side    
       
      <input type="radio" name="FamilyHistory" id="FamilyHistory" value="Yes Mother" />
      Yes Mother's Side    
       
      <input type="radio" name="FamilyHistory" id="FamilyHistory" value="No" />
      No    </p>
<p><h2><strong><u>Blood Results: </u></strong></h2> Date of Results:
        <input name="dobr" type="text" id="dobr" size="8" />     <font size="2">(ex. 10/26/1985)</font>
      </p>
<p>Abnormal Hematology:<br>
        <input name="Hematology[]" type="checkbox" id="Hematology[]" value=" Hb" />
        Hb    
        <input name="Hematology[]" type="checkbox" id="Hematology[]" value=" WCC" />
        WCC    
        <input name="Hemotology[]" type="checkbox" id="Hematology[]" value=" Platelets" />
        Platelets    </p>
<p>Abnormal Hepatic Function:<br>
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" Bilirubin" />
        Bilirubin    
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" ALK P" />
        ALK P    
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" ALT" />
        ALT    
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" ATT" />
        ATT    
        <input name="Hepatic[]" type="checkbox" id="Hepatic[]" value=" Albumin" />
        Albumin    </p>
<p>Abnormal Renal Function:<br>
        <input name="Renal[]" type="checkbox" id="Renal[]" value=" Urea" />
        Urea    
        <input name="Renal[]" type="checkbox" id="Renal[]" value=" Creatinine" />
        Creatinine    
</p>
<p>Biomarkers:<br>
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" NETest" />
        NETest    
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" Chromogranin A" />
        Chromogranin A    
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" Pancreastatin" />
        Pancreastatin    
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" Serotonin" />
        Serotonin    
        <input name="Biomarker[]" type="checkbox" id="Biomarker[]" value=" U-5HIAA" />
        U-5HIAA    
        <input name="Biomarker[]" type="text" id="Biomarker[]" size="10"/>
        Other    
</p>
<p> Abnormal Elevated Biomarkers:<br>
Yes  : <input type="radio" name="AbnormalElevatedNETest" id="AbnormalElevatedNETest" value="Yes" />                    
	<input type="radio" name="AbnormalElevatedCgA" id="AbnormalElevatedCgA" value="Yes" />                            
	<input type="radio" name="AbnormalElevatedPancreastatin" id="AbnormalElevatedPancreastatin" value="Yes" />                        
	<input type="radio" name="AbnormalElevatedSerotonin" id="AbnormalElevatedSerotonin" value="Yes" />                     
	<input type="radio" name="AbnormalElevatedU5HIAA" id="AbnormalElevatedU5HIAA" value="Yes" />                    
	<input type="radio" name="AbnormalElevatedOtherBiomarker" id="AbnormalElevatedOtherBiomarker" value="Yes" />
	<br> 
No   : <input type="radio" name="AbnormalElevatedNETest" id="AbnormalElevatedNETest" value="No" />                    
	<input type="radio" name="AbnormalElevatedCgA" id="AbnormalElevatedCgA" value="No" />                            
	<input type="radio" name="AbnormalElevatedPancreastatin" id="AbnormalElevatedPancreastatin" value="No" />                        
	<input type="radio" name="AbnormalElevatedSerotonin" id="AbnormalElevatedSerotonin" value="No" />                     
	<input type="radio" name="AbnormalElevatedU-5HIAA" id="AbnormalElevatedU-5HIAA" value="No" />                    
	<input type="radio" name="AbnormalElevatedOtherBiomarker" id="AbnormalElevatedBiomarker" value="No" />
<br>      NETest                 CgA                      Pancreastatin         Serotonin              U-5IAA           Other Biomarkers
	</p>
<p><h2><strong><u>Tumor Location:</u></strong></h2>
Primary Location: 
 	<select name="PrimaryLocation">
	  <option value="SmallBowel">Small Bowel</option>
	  <option value="Pancreas">Pancreas</option>
	  <option value="Rectum">Rectum</option>
	  <option value="Gastric">Gastric</option>
	  <option value="Appendix">Appendix</option>
	  <option value="Colon">Colon</option>
	  <option value="Duodenum">Duodenum</option>
	  <option value="Lung">Lung</option>
	  <option value="Other">Other</option>
	 </select>
           
      Current Status:
 	<select name="cancerStatus">
	  <option value="Pre-Surgery">Pre-Surgery</option>
	  <option value="Post Surgery">Post Surgery</option>
	  <option value="Recurrence">Recurrence</option>
	 </select>
    
      Current Stage:
 	<select name="cancerStage">
	  <option value="0">Stage 0</option>
	  <option value="1">Stage 1</option>
	  <option value="2">Stage 2</option>
	  <option value="3">Stage 3</option>
	  <option value="4">Stage 4</option>
     </select>
<br><br>
Metastasis (Second Location):
 	<select name="SecondaryLocation">
	  <option value="No Secondary">No Secondary Tumor</option>
	  <option value="Liver">Liver</option>
	  <option value="LymphNodes">Lymph Nodes</option>
	  <option value="Peritoneum">Peritoneum</option>
	  <option value="Lung">Lung</option>
	  <option value="Bone">Bone</option>
	  <option value="Brain">Brain</option>
	  <option value="Other">Other</option>
	  <option value="Multiple">Multiple Locations</option>
     </select>
</p>
<p><h2><strong><u>Histopathology:</u></strong></h2>
      <input type="radio" name="Histopathology" id="Histopathology" value="Yes" />
      Yes    
       
      <input type="radio" name="Histopathology" id="Histopathology" value="No" />
      No                          
	  Date of Hisopathology:  <input name="dobr" type="text" id="dobr" size="8" />     <font size="2">(ex. 10/26/1985)</font>
<br><br><font size="4"><u>Lungs:</u></font><br>
     <input type="radio" name="HistopathologyLung" id="HistopathologyLung" value="Typical Carinoid" />
      Typical Carinoid    
       
      <input type="radio" name="HistopathologyLung" id="HistopathologyLung" value="Atypical Carcinoid" />
      Atypical Carcinoid
      <input type="radio" name="HistopathologyLung" id="HistopathologyLung" value="Large Cell NEC" />
      Large Cell NEC
      <input type="radio" name="HistopathologyLung" id="HistopathologyLung" value="Small Cell NEC" />
      Small Cell NEC
<br><br><font size="4"><u>GEP-NET:</u></font><br>
     <input type="radio" name="HistopathologyGEPNET" id="HistopathologyGEPNET" value="Well Differentiated" />
      Well Differentiated 
     <input type="radio" name="HistopathologyGEPNET" id="HistopathologyGEPNET" value="Moderately Differentiated" />
      Moderately Differentiated 
     <input type="radio" name="HistopathologyGEPNET" id="HistopathologyGEPNET" value="Poorly Differentiated" />
      Poorly Differentiated 
<br><br><font size="4"><u>Ki-67:</u></font><br>
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="< 2%" />
      < 2% 
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="2-5%" />
      2-5% 
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="6-10%" />
      6-10% 
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="11-20%" />
     11-20% 
     <input type="radio" name="HistopathologyKi67" id="HistopathologyKi67" value="> 20%" />
      > 20% 
<br><br><font size="4"><u>Mitoses (Lung):</u></font><br>
     <input type="radio" name="HistopathologyMitoses(Lung)" id="HistopathologyMitoses(Lung)" value="< 3 HPF" />
      < 3 HPF 
     <input type="radio" name="HistopathologyMitoses(Lung)" id="HistopathologyMitoses(Lung)" value="4-10 HPF" />
      4-10 HPF 
     <input type="radio" name="HistopathologyMitoses(Lung)" id="HistopathologyMitoses(Lung)" value="> 10 HPF" />
      > 10 HPF 
<br>No Necrosis                                   Necrosis
<br><br><font size="4"><u>Mitoses (GEP-NETs):</u></font><br>
     <input type="radio" name="HistopathologyMitoses(GEP-NETs)" id="HistopathologyMitoses(GEP-NETs)" value="< 2 HPF" />
      < 2 /10HPF 
     <input type="radio" name="HistopathologyMitoses(GEP-NETs)" id="Histopathology Mitoses(GEP-NETs)" value="2-20 HPF" />
      2-20HPF 
     <input type="radio" name="HistopathologyMitoses(GEP-NETs)" id="HistopathologyMitoses(GEP-NETs)" value="> 20 HPF" />
      > 20 HPF 
</p>
<p><h2><strong><u>Imaging:</u></strong></h2>
<h4><u>Ostreoscan</u></h4>
     <input type="radio" name="Ostreoscan" id="Ostreoscan" value="Yes" />      Yes     
      <input type="radio" name="Ostreoscan" id="Ostreoscan" value="No" />
      No                              Date of Scan:
	  <input name="OstreoscanDate" type="text" id="OstreoscanDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
Was your Osetreoscan results Positive or Negative?<br>
     <input type="radio" name="Ostreoscan+/-" id="Ostreoscan+/-" value="Positive" />
      Positive    
       
      <input type="radio" name="Ostreoscan+/-" id="Ostreoscan+/-" value="Negative" />
      Negative<br><br>
What area did you have Scanned?<br>
	        <input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Primary" /> Primary  
			<input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Lymph Node" /> Lymph Node  
			<input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Peritoneum" /> Peritoneum  
			<input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Bone" /> Bone  
			<input type="radio" name="OstreoscanArea" id="OstreoscanArea" value="Liver" /> Liver   
			Other:  <input name="OstreoscanArea" type="text" id="OstreoscanArea" size="10" /> 
<br><br>If you had the liver scanned what area showed activity?<br>
			<input type="radio" name="OstreoscanLiverLobe" id="OstreoscanLiverLobe" value="Left" /> Left	
			<input type="radio" name="OstreoscanLiverLobe" id="OstreoscanLiverLobe" value="Right" /> Right
			<input type="radio" name="OstreoscanLiverLobe" id="OstreoscanLiverLobe" value="Both" /> Both<br><br>
			<input type="radio" name="OstreoscanLesions" id="OstreoscanLesions" value="<2" />	<2
			<input type="radio" name="OstreoscanLesions" id="OstreoscanLesions" value="2-5" /> 2-5
			<input type="radio" name="OstreoscanLesions" id="OstreoscanLesions" value="5-10" /> 5-10
			<input type="radio" name="OstreoscanLesions" id="OstreoscanLesions" value=">10" /> >10              
			<input type="radio" name="OstreoscanUptake" id="OstreoscanUptake" value="1" /> 1
			<input type="radio" name="OstreoscanUptake" id="OstreoscanUptake" value="2" /> 2
			<input type="radio" name="OstreoscanUptake" id="OstreoscanUptake" value="3" /> 3
			<input type="radio" name="OstreoscanUptake" id="OstreoscanUptake" value="4" /> 4
			<br>            Number of Lesions                           Uptake (Krenning Scale)
			
<h4><u>CT Scan</u></h4>
     <input type="radio" name="CTScan" id="CTScan" value="Yes" />      Yes     
      <input type="radio" name="CTScan" id="CTScan" value="No" />
      No                              Date of Scan:
	  <input name="CTScanDate" type="text" id="CTScanDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
Was your CT Scan results Positive or Negative?<br>
     <input type="radio" name="CTScan+/-" id="CTScan+/-" value="Positive" />
      Positive    
       
      <input type="radio" name="CTScan+/-" id="CTScan+/-" value="Negative" />
      Negative<br><br>
What area did you have Scanned?<br>
	        <input type="radio" name="CTScanArea" id="CTScanArea" value="Primary" /> Primary  
			<input type="radio" name="CTScanArea" id="CTScanArea" value="Lymph Node" /> Lymph Node  
			<input type="radio" name="CTScanArea" id="CTScanArea" value="Peritoneum" /> Peritoneum  
			<input type="radio" name="CTScanArea" id="CTScanArea" value="Bone" /> Bone  
			<input type="radio" name="CTScanArea" id="CTScanArea" value="Liver" /> Liver   
			Other:  <input name="CT Scan Area" type="text" id="CT Scan Area" size="10" /> 
<br><br>If you had the liver scanned what area showed activity?<br>
			<input type="radio" name="CTScanLiverLobe" id="CTScanLiverLobe" value="Left" /> Left	
			<input type="radio" name="CTScanLiverLobe" id="CTScanLiverLobe" value="Right" /> Right
			<input type="radio" name="CTScanLiverLobe" id="CTScanLiverLobe" value="Both" /> Both<br><br>
			<input type="radio" name="CTScanLesions" id="CTScanLesions" value="<2" />	<2
			<input type="radio" name="CTScanLesions" id="CTScanLesions" value="2-5" /> 2-5
			<input type="radio" name="CTScanLesions" id="CTScanLesions" value="5-10" /> 5-10
			<input type="radio" name="CTScanLesions" id="CTScanLesions" value=">10" /> >10              
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value="<1/2" /> <1/2
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value="1" /> 1
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value="1-2" /> 1-2
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value="2-3" /> 2-3
			<input type="radio" name="CTScanSizeofMetastases" id="CTScanSizeofMetastases" value=">3" /> >3
			<br>            Number of Lesions                                      Size of Metastases (cm)
			
<h4><u>MRI Scan</u></h4>
     <input type="radio" name="MRIScan" id="MRIScan" value="Yes" />      Yes     
      <input type="radio" name="MRIScan" id="MRIScan" value="No" />
      No                              Date of Scan:
	  <input name="MRIScanDate" type="text" id="MRIScanDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
Was your MRI Scan results Positive or Negative?<br>
     <input type="radio" name="MRIScan+/-" id="MRIScan+/-" value="Positive" />
      Positive    
       
      <input type="radio" name="MRIScan+/-" id="MRIScan+/-" value="Negative" />
      Negative<br><br>
What area did you have Scanned?<br>
	        <input type="radio" name="MRIScanArea" id="MRIScanArea" value="Primary" /> Primary  
			<input type="radio" name="MRIScanArea" id="MRIScanArea" value="Lymph Node" /> Lymph Node  
			<input type="radio" name="MRIScanArea" id="MRIScanArea" value="Peritoneum" /> Peritoneum  
			<input type="radio" name="MRIScanArea" id="MRIScanArea" value="Bone" /> Bone  
			<input type="radio" name="MRIScanArea" id="MRIScanArea" value="Liver" /> Liver   
			Other:  <input name="MRIScanArea" type="text" id="MRIScanArea" size="10" /> 
<br><br>If you had the liver scanned what area showed activity?<br>
			<input type="radio" name="MRIScanLiverLobe" id="MRIScanLiverLobe" value="Left" /> Left	
			<input type="radio" name="MRIScanLiverLobe" id="MRIScanLiverLobe" value="Right" /> Right
			<input type="radio" name="MRIScanLiverLobe" id="MRIScanLiverLobe" value="Both" /> Both<br><br>
			<input type="radio" name="MRIScanLesions" id="MRIScanLesions" value="<2" />	<2
			<input type="radio" name="MRIScanLesions" id="MRIScanLesions" value="2-5" /> 2-5
			<input type="radio" name="MRIScanLesions" id="MRIScanLesions" value="5-10" /> 5-10
			<input type="radio" name="MRIScanLesions" id="MRIScanLesions" value=">10" /> >10              
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value="<1/2" /> <1/2
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value="1" /> 1
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value="1-2" /> 1-2
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value="2-3" /> 2-3
			<input type="radio" name="MRIScanSizeofMetastases" id="MRIScanSizeofMetastases" value=">3" /> >3
			<br>            Number of Lesions                                      Size of Metastases (cm)
<h4><u>FDG Scan</u></h4>
     <input type="radio" name="FDGScan" id="FDGScan" value="Yes" />      Yes     
      <input type="radio" name="FDGScan" id="FDGScan" value="No" />
      No                              Date of Scan:
	  <input name="FDGScanDate" type="text" id="FDGScanDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
Was your FDG Scan results Positive or Negative?<br>
     <input type="radio" name="FDGScan+/-" id="FDGScan+/-" value="Positive" />
      Positive    
       
      <input type="radio" name="FDGScan+/-" id="FDGScan+/-" value="Negative" />
      Negative<br><br>
What area did you have Scanned?<br>
	        <input type="radio" name="FDGScanArea" id="FDGScanArea" value="Primary" /> Primary  
			<input type="radio" name="FDGScanArea" id="FDGScanArea" value="Lymph Node" /> Lymph Node  
			<input type="radio" name="FDGScanArea" id="FDGScanArea" value="Peritoneum" /> Peritoneum  
			<input type="radio" name="FDGScanArea" id="FDGScanArea" value="Bone" /> Bone  
			<input type="radio" name="FDGScanArea" id="FDGScanArea" value="Liver" /> Liver   
			Other:  <input name="FDGScanArea" type="text" id="FDGScanArea" size="10" /> 
<br><br>If you had the liver scanned what area showed activity?<br>
			<input type="radio" name="FDGScanLiverLobe" id="FDGScanLiverLobe" value="Left" /> Left	
			<input type="radio" name="FDGScanLiverLobe" id="FDGScanLiverLobe" value="Right" /> Right
			<input type="radio" name="FDGScanLiverLobe" id="FDGScanLiverLobe" value="Both" /> Both<br><br>
			<input type="radio" name="FDGScanLesions" id="FDGScanLesions" value="<2" />	<2
			<input type="radio" name="FDGScanLesions" id="FDGScanLesions" value="2-5" /> 2-5
			<input type="radio" name="FDGScanLesions" id="FDGScanLesions" value="5-10" /> 5-10
			<input type="radio" name="FDGScanLesions" id="FDGScanLesions" value=">10" /> >10              
			
			L1: <input name="FDGScanL1SUVmax" type="text" id="FDGScanL1SUVmax" size="1" />
			L2: <input name="FDGScanL2SUVmax" type="text" id="FDGScanL2SUVmax" size="1" />
			L3: <input name="FDGScanL3SUVmax" type="text" id="FDGScanL3SUVmax" size="1" />
			L4: <input name="FDGScanL4SUVmax" type="text" id="FDGScanL4SUVmax" size="1" />
			L5: <input name="FDGScanL5SUVmax" type="text" id="FDGScanL5SUVmax" size="1" /> KBq/ml 
			<br>            Number of Lesions                                              SUVmax (<font size="2">Kilobecquerel/ per Millileter)</font>
			<h4><u>Isotope Imaging</u></h4>
     <input type="radio" name="IsotopeImaging" id="IsotopeImaging" value="Yes" />      Yes     
      <input type="radio" name="IsotopeImaging" id="IsotopeImaging" value="No" />
      No                              Date of Scan:
	  <input name="IsotopeImageDate" type="text" id="IsotopeImageDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
      Type of Tracer:<br>
	  <input name="IsotopeTracer[]" type="checkbox" id="IsotopeTracer[]" value="Ga" /> Ga
	  <input name="IsotopeTracer[]" type="checkbox" id="IsotopeTracer[]" value="Fluro-DOPA" /> Fluro-DOPA
	  <input name="IsotopeTracer[]" type="checkbox" id="IsotopeTracer[]" value="C-HTP" /> C-HTP
	  <input name="IsotopeTracer[]" type="checkbox" id="IsotopeTracer[]" value="Tc-OCT" /> Tc-OCT   
	  Other:  <input name="IsotopeTracer[]" type="text" id="IsotopeTracer[]" size="10" />  <br><br>
	  Did the Tracer Work?<br>
	  <input type="radio" name="IsotopeTracerWorking" id="IsotopeTracerWorking" value="Yes" />      Yes     
      <input type="radio" name="IsotopeTracerWorking" id="IsotopeTracerWorking" value="No" /> No<br><br>
	  Type of Conjugand:<br>
	  <input name="IsotopeConjugand[]" type="checkbox" id="IsotopeConjugand[]" value="TATE" /> TATE
	  <input name="IsotopeConjugand[]" type="checkbox" id="IsotopeConjugand[]" value="TOC" /> TOC
	  <input name="IsotopeConjugand[]" type="checkbox" id="IsotopeConjugand[]" value="NOC" /> NOC<br><br>
	  SUVmax:<br>
	  			Lesion 1: <input name="IsotopeL1SUVmax" type="text" id="IsotopeL1SUVmax" size="1" /> KBq/ml<br>
			Lesion 2: <input name="IsotopeL2SUVmax" type="text" id="IsotopeL2SUVmax" size="1" /> KBq/ml<br>
			Lesion 3: <input name="IsotopeL3SUVmax" type="text" id="IsotopeL3SUVmax" size="1" /> KBq/ml<br>
			Lesion 4: <input name="IsotopeL4SUVmax" type="text" id="IsotopeL4SUVmax" size="1" /> KBq/ml<br>
			Lesion 5: <input name="IsotopeL5SUVmax" type="text" id="IsotopeL5SUVmax" size="1" /> KBq/ml
</p>
<p>
<h2><strong><u>Surgery:</u></strong></h2>
<h4><u>Primary:</u></h4>
     <input type="radio" name="PrimarySurgery" id="PrimarySurgery" value="Yes" /> Yes     
      <input type="radio" name="PrimarySurgery" id="PrimarySurgery" value="No" /> No
	                           Date of Surgery:
	  <input name="PrimarySurgeryDate" type="text" id="PrimarySurgeryDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
<u>GI Tract</u><br>
	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Small Bowel Resection" />    Small Bowel Resection     
	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Right Hemicolectomy" />   Right Hemicolectomy     
	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Whipple Resection" />    Whipple Resection    
	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Enucleation" />    Enucleation    
 	  <input type="radio" name="PrimaryGITractSurgery" id="PrimaryGITractSurgery" value="Tail Resection" />    Tail Resection     
	  Other:  <input name="PrmaryGITractSurgery" type="text" id="PrimaryGITractSurgery" size="10" /><br><br>
	  <u>Lung</u><br>
	  <input type="radio" name="PrimaryLungSurgery" id="PrimaryLungSurgery" value="Lobectomy Resection" />   Lobectomy Resection     
	  <input type="radio" name="PrimaryLungSurgery" id="PrimaryLungSurgery" value="Sleeve Resection" />   Sleeve Resection     
	  <br><br><h4><u>Metastases:</u></h4>
	  <input type="radio" name="MetastasesSurgery" id="MetastasesSurgery" value="Yes" /> Yes     
      <input type="radio" name="MetastasesSurgery" id="MetastasesSurgery" value="No" /> No
	                            Date of Surgery:
	  <input name="MetastasesSurgeryDate" type="text" id="MetastasesSurgeryDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
<u>Liver</u><br>
	  <input type="radio" name="MetastasesLiverSurgery" id="MetastasesLiver Surgery" value="Right Lobectomy" />    Right Lobectomy     
	  <input type="radio" name="MetastasesLiverSurgery" id="MetastasesLiver Surgery" value="Left Lobectomy" />    Left Lobectomy     
	  <input type="radio" name="MetastasesLiverSurgery" id="MetastasesLiver Surgery" value="Wedge Resection" />    Wedge Resection     
	  <input type="radio" name="MetastasesLiverSurgery" id="MetastasesLiver Surgery" value="Cherry Picking" />    Cherry Picking     
	  	  Other:  <input name="MetastasesLiverSurgery" type="text" id="MetastasesLiverSurgery" size="10" /><br><br>
<u> Lung</u><br>
	  <input type="radio" name="MetastasesLungSurgery" id="MetastasesLungSurgery" value="Right Lobectomy" />    Right Lobectomy     
	  <input type="radio" name="MetastasesLungSurgery" id="MetastasesLungSurgery" value="Left Lobectomy" />    Left Lobectomy    
	  <input type="radio" name="MetastasesLungSurgery" id="MetastasesLungSurgery" value="Wedge Resection" />    Wedge Resection    
	  Other:  <input name="MetastasesLungSurgery" type="text" id="MetastasesLungSurgery" size="10" /><br>
		  <br><h4><u>Staging:</u></h4>
	  <input type="radio" name="Staging" id="Staging" value="Yes" /> Yes     
      <input type="radio" name="Staging" id="Staging" value="No" /> No
	                           Date of Surgery:
	  <input name="StagingDate" type="text" id="StagingDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
	  Primary Tumor(T)       Regional Lymph Nodes (N)       Distant Metastasisx (M)<br>
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="T1" />      
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="T2" />    
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="T3" />    
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="T4" />                      
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="N0" />    
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="N1" />                            
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="M0" />    
	  <input type="checkbox" name="Staging#[]" id="Staging#[]" value="M1" />    
	  <br> T1    T2    T3    T4                     N0    N1                         M0   M1
	  </p>

<p><h2><strong><u>Interventions:</u></strong></h2>
	  <input type="radio" name="Interventions" id="Interventions" value="Yes" /> Yes     
      <input type="radio" name="Interventions" id="Interventions" value="No" /> No
	                            Date of Intervention:
	  <input name="Intervention Date" type="text" id="Intervention Date" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="Bland Embolization"> Bland Embolization<br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="Chemo Embolization"> Chemo Embolization<br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="SIRT"> SIRT<br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="Thera Spheres"> Thera Spheres<br>
	  <input type="checkbox" name="TypeofInterventions[]" id="TypeofInterventions[]" value="RFA"> RFA<br>
 Other:  <input name="TypeofInterventions" type="text" id="TypeofInterventions" size="10" /><br>
	  <h4><u>PRRT:</u></h4>
	  	  <input type="radio" name="PRRT" id="PRRT" value="Yes" /> Yes     
      <input type="radio" name="PRRT" id="PRRT" value="No" /> No
	                            Date of PRRT:
	  <input name="PRRTDate" type="text" id="PRRTDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
	  <br>Drug for intervention:<br><input type="checkbox" name="TypeofPRRT[]" id="TypeofPRRT[]" value="Lutetium">Lutetium
	  <input type="checkbox" name="TypeofPRRT[]" id="TypeofPRRT[]" value="Yttrium">Yttrium<br><br>
	 Number of Cycles: 
 	<select name="Number of Cylces">
	  <option value="0">No PRRT</option>
	  <option value="1">1 Cycle</option>
	  <option value="2">2 Cycles</option>
	  <option value="3">3 Cycles</option>
	  <option value="4">4 Cycles</option>
	  <option value="5">5 Cycles</option>
	 </select><br><br>
	 Dosage:
	 <input name="PRRT Dose" type="text" id="PRRT Dose" size="8" />MBq/per cycle <font size="2">(Megabecquerel per cycle)</font>
</p>

<p><h2><strong><u>Medication:</u></strong></h2>
<h4><u>SSAs:</u></h4>
<input type="radio" name="SSAs" id="SSAs" value="Yes" />Yes   
<input type="radio" name="SSAs" id="SSAs" value="No" />No         
Date:   <input name="SSAsDate" type="text" id="SSAsDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br><br>
SSAs given medication:<br>
<input type="radio" name="SSAsType" id="SSAsType" value="Sandostatin" />Sandostatin   
<input type="radio" name="SSAsType" id="SSAsType" value="Lanreotide" />Lanreotide   <br><br>
Amount of SSAs medication taken daily:<br>
<input type="radio" name="SSAsAmount" id="SSAsAmount" value="10mg" />10mg   
<input type="radio" name="SSAsAmount" id="SSAsAmount" value="20mg" />20mg   
<input type="radio" name="SSAsAmount" id="SSAsAmount" value="30mg" />30mg   
<input type="radio" name="SSAsAmount" id="SSAsAmount" value="40mg" />40mg   
Other Amounts:  <input name="SSAsAmount" type="text" id="SSAsAmount" size="1" />mg<br><br>
Duration of SSA Medication:<br><input name="SSAs Durration (Months) " type="text" id="SSAs Durration (Months)" size="2" />    Months <font size="2">(ex. 34 is 2 years and 10 months)</font>
<br><h4><u>Everolimus:</u></h4>
<input type="radio" name="Everolimus" id="Everolimus" value="Yes" />Yes   
<input type="radio" name="Everolimus" id="Everolimus" value="No" />No   
      Date:   <input name="EverolimusDate" type="text" id="EverolimusDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
<h4><u>Sunitnib:</u></h4>
<input type="radio" name="Sunitnib" id="Sunitnib" value="Yes" />Yes   
<input type="radio" name="Sunitnib" id="Sunitnib" value="No" />No   
      Date:   <input name="SunitnibDate" type="text" id="SunitnibDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
<h4><u>Bevacizumab:</u></h4>
<input type="radio" name="Bevacizumab" id="Bevacizumab" value="Yes" />Yes   
<input type="radio" name="Bevacizumab" id="Bevacizumab" value="No" />No   
      Date:   <input name="BevacizumabDate" type="text" id="BevacizumabDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
<h4><u>Chemotherapy:</u></h4>
<input type="radio" name="Chemotherapy" id="Chemotherapy" value="Yes" />Yes   
<input type="radio" name="Chemotherapy" id="Chemotherapy" value="No" />No   
      Date:   <input name="ChemoDate" type="text" id="ChemoDate" size="8" />  <font size="2">(ex. 10/26/1985)</font><br>
        <br>Type of Chemotherapy:<br><input name="ChemoTreatment[]" type="checkbox" id="ChemoTreatment[]" value="Temozolomide" />
        Temozolomide    
        <input name="ChemoTreatment[]" type="checkbox" id="ChemoTreatment[]" value="5-FU" />
        5-FU    
        <input name="ChemoTreatment[]" type="checkbox" id="ChemoTreatment[]" value="Streptozotozin" />
        Streptozotozin    
        <input name="ChemoTreatment[]" type="checkbox" id="ChemoTreatment[]" value="Cisplatin" />
        Cisplatin    
        Other:  <input name="ChemoTreatment[]" type="text" id="ChemoTreatment[]" size="8" />
</p>
<input type="submit" name="submit" id="submit" value="Submit" />
<input type="reset" name="clear" value="Clear">
      </p>
    </form>
    <!-- end #mainContent -->
  </div>
  <div id="footer">
   <!-- end #footer -->
  </div>
  <!-- end #container -->
</div>
</body>
</html>
Edited by QuickOldCar

i'm not sure why people keep writing-out/copy/paste/over-type line after line after line after line of repetitive code, for hours on end, that only differs in the the variables/names between lines of code in a section. programming is already a tedious task. creating all this repeating logic, unless you are using it to learn touch-typing, isn't an effective use of time and isn't using the computer as a tool to get a job done.

 

dynamically get the computer to do this for you, by operating on the data as a SET by using php's array functions. define all the form fields in an array, with the form field name, label, the field type, choices for check boxes and radio buttons, validation rules, ... that would let you simply loop over the definition to produce the form and process the form data.

 

an example of trimming all the form data at once, by treating it as a SET of data -

$data = array_map('trim',$_POST); // get a copy of the trimmed data - and if you are submitting arrays of data, just make a call-back function and use array_walk_recursive() instead.

this one line eliminates all those 20-40 sets of logic and eliminates all the typo's and checking to make sure you have logic for each input.

 

just reference $data['form_field_name_here'] to use the trimmed data. dynamically reference any existing form data when you are looping over the defining array to displaying the form. dynamically reference any error array elements the same way.

 

doing this also has the advantage of implement DRY (Don't Repeat Yourself) programming, because any particular code/markup will only exist once, so if you need to fix or change what it does, you only have to make the change in one place.

 

once you have implemented this for one form, you now have a form-generator/processor that you can use to implement any form, simply by changed the defining array and changing any code that uses the submitted form data. you would even use the defining array to dynamically produce an INSERT query for a database design, the fputcsv() statements for a file based design, or build the message body for an email based design, all without writing out code for every value that's being operated on.

Edited by mac_gyver

The OP probably wont understand it but IMO it is the OP that needs to step up their knowledge and learn what was presented to them as the better/right way rather than us dumb it down for them. Now the OP has heard of new things and can look up how to use them. Like you, there is also only so much time and effort I want to put into any OP's post. Enough was presented here to keep the OP busy learning for awhile should he choose to do so.

Edited by benanamen

in the time the OP will need to spend to finish adding code to repopulate fields/check-boxes/radio-buttons with existing values, to display errors for each field, and to fix all the other problems in the code, times the number of form fields, and to also fix all the errors caused by typo's in the discrete/hard-coded field/variable names, he can learn enough php so that he would understand what a ternary operator is or to make use of the suggested method.

 

for the OP, here's a basic example that shows the method i suggested for an input type='text' field. all the type= text, password, hidden, and submit fields you currently have would be handled by this method (with the addition of a switch/case statement.) adding code to handle checkbox/radiobuttons is not difficult, with a little php and html knowledge. see the comments in the code in any case.

<?php
// using arrays, you would define the form fields and just loop over the array to output all the form fields, rather than to write them out by hand
// this example shows only one field

// notes:
// the array key is the form field name.
// for the form field type, you would actually have a switch/case statement for the different types to output the correct html for each different type.
// the 'value' entry is 'y' to determine if you output any existing value for a field. for a password field, you would typically not output any previously entered value.
$fields['userName'] = array('legend'=>'Username','required'=>'y','type'=>'text','value'=>'y');
// you would add the rest of the field definitions here... you can produce the submit buttons too, by defining them in this array


// form processing code, first check if a form was submitted -
if($_SERVER['REQUEST_METHOD'] == 'POST'){

    $errors = array(); // holds validation errors
    $data = array_map('trim',$_POST); // make a trimmed copy of all post data

    // check all required fields for being an empty string
    foreach($fields as $field => $arr){
        if(isset($arr['required']) && $arr['required'] == 'y' && $data[$field] == ''){
            $errors[$field] = "* {$arr['legend']} is required";
        }
    }
        
    // all required fields have been checked for empty at this point, perform additional validation tests here...
    // you can add rules in the defining array, with things like regex patterns, php string filter function names... and have your code dynamically use that information to validate the fields as you simply loop over them, not hard-code logic for every input
        
    // at this point all validation tests have been performed. if there are no errors, you can use the form data
    if(empty($errors)){
        // Insert your code for using the form data here, e.g emailing the submission, entering it into a database.
        echo 'Done using the form data';
    }
    // if there are no form errors at this point, you would actually do a header() redirect to the same url that the form submtited to, in order to cause a get request for the page. this will clear the post data so that the browser won't try to resubmit the data if you refresh the page or browse back to the same url.

    // if there are form errors, you would continue on this page and let the following code run to display the form, populate the form with existing data, and display any errors.
}

// get request code would go here... if you are retrieving data to edit/update it, if the $data array doesn't exsit at this point, the form hasn't been submitted. retrieve any existing data and store it in the $data array.

// produce the form, populating it with any existing data values, and display any errors
?>
<form method="post">
<?php
    foreach($fields as $field=>$arr){
        // note: this example is only for <input type='...'> fields. to address all the possible types of form fields, you would use a switch/case statement to output the correct markup for each different type
        echo "<label>{$arr['legend']}: <input type='{$arr['type']}' name='$field' value='".(isset($arr['value']) && $arr['value'] == 'y' && isset($data[$field]) ? $data[$field] : '')."'><span class='error'>".(isset($errors[$field]) ? $errors[$field] : '')."</span></label><br>";
    }
?>
<input type="submit">
</form>
  • Like 1

@mac_gyver, nice job on explaining a form generator with arrays. I have used the same technique before.

 

 

Just wanted to point out that the array_map line will not work with multidimensional arrays.

$data = array_map('trim',$_POST); // make a trimmed copy of all post data

 

 

I have a function that will trim recursively I use that handles it either way. You can test by switching the commented code. If you know of a better/other way, would love to see it.  :happy-04: 

function TrimArray($Input){

    if (!is_array($Input))
        return trim($Input);

    return array_map('TrimArray', $Input);
}

$_POST = array
  (
  array("   Volvo     ",22,18),
  array("BMW      ",15,13),
  array("    Saab",5,2),
  array("            Land Rover          ",17,15)
  );


$_POST = array_map('trim',$_POST); // Wont work
//$_POST = TrimArray($_POST);// Will work

echo "<pre>";
print_r($_POST);
echo "</pre>";

 

Edited by benanamen

Thank you so much for all the input! I will take all the advice, even though I am not an html coder, I do know C and C++ so the explanations were understood, and I will get working on the fixes to the form. I cannot thank you enough, I will eventually get the hang of php code now that I have gotten better code to look at and understand. What's the best way to get the hang of php code? and is there a good editor to use to tell you that a line wont work, or will give you a suggestion on what line of code you should use in different areas?

@NickWrenLab, that is the kind of response we love to get. You would be amazed at how many "coders" get all bent out of shape when you tell them how bad their code is. There are numerous resource to learn php. Code Academy is a good place to start.

 

https://www.codecademy.com/learn/php

 

There are many editors, free and paid. Try them and see what you like. I use Webuilder but it is not free. I am sure others will give recommendations.

Just wanted to point out that the array_map line will not work with multidimensional arrays.

 

 

there's a comment about that in the first of my posts -

 

 

// get a copy of the trimmed data - and if you are submitting arrays of data, just make a call-back function and use array_walk_recursive() instead.

 

and is there a good editor to use to tell you that a line wont work, or will give you a suggestion on what line of code you should use in different areas?

 

 

no. the only one who knows what the context is for any line of code and goal you are trying to achieve is the person writing the code. it's up to the programmer to know what the statements being used do, so that they know how they will contribute to the goal being worked on, and to know if they belong in the code at all and where they belong at. putting the correct statements together in a meaningful way to accomplish a goal is the creative part of programming.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.