I am new to PHP code. I built this form as a note-taking form. I need to be able to import the options from an external document either excel, notepad, therefore, I don’t need to change the form each time for an option change. I can’t figure out how to do it.
<?php // define variables and set to empty values $nameErr = $numberErr = $exposureErr = $oborefErr = $rfcoptionErr = $csroptionErr = ""; $name = $number = $exposure = $comment = $oboref = $rfcoption = $csroption = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) { $nameErr = "Name is required"; } else { $name = test_input($_POST["name"]); } if (empty($_POST["number"])) { $numberErr = "Number is required"; } else { $number = test_input($_POST["number"]); } if (empty($_POST["oboref"])) { $oboref = ""; } else { $oboref = test_input($_POST["oboref"]); } if (empty($_POST["rfcoption"])) { $rfcoption = ""; } else { $rfcoption = test_input($_POST["rfcoption"]); } if (empty($_POST["csroption"])) { $csroption = ""; } else { $csroption = test_input($_POST["csroption"]); } if (empty($_POST["adjuster"])) { $adjuster = ""; } else { $adjuster = test_input($_POST["adjuster"]); } if (empty($_POST["callertype"])) { $callertype = ""; } else { $callertype = test_input($_POST["callertype"]); } if (empty($_POST["comment"])) { $comment = ""; } else { $comment = test_input($_POST["comment"]); } if (empty($_POST["exposure"])) { $exposureErr = "exposure is required"; } else { $exposure = test_input($_POST["exposure"]); } } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?> <div class="row align-items-start">
<div class="col">
<h2 class="text-center">Call Tracking Tool <span id="timer" style="font-size: 14px; color: black;",></span></h2></div>
</div>
<form method="post" action="<?php echo htmlspecialchars($_SERVER[" PHP_SELF "]);?>">
<p style="padding-bottom: 0px; margin-bottom: 0px; color: #AF4331; font-size: 14px;"><i class="fas fa-check" style="display:inline;padding-right:3px;"></i>Select Exposure</p>
<div class="row align-items-start">
<div class="col form-check">
<input class="form-check form-check-inline" type="radio" name="exposure" value="PD">
<label class="form-check-label" for="PD">exposure 1</label>
<input class="form-check form-check-inline" type="radio" name="exposure" value="Coll">
<label class="form-check-label" for="Coll">exposure 2</label>
<input class="form-check form-check-inline" type="radio" name="exposure" value="PIP">
<label class="form-check-label" for="PIP">exposure 3</label>
<input class="form-check form-check-inline" type="radio" name="exposure" value="BI">
<label class="form-check-label" for="BI">exposure 4</label>
</div>
</div>
<hr style="margin: 0px; padding-bottom: 10px;">
<p style="padding-bottom: 0px; margin-bottom: 0px; color: #AF4331; font-size: 14px;"><i class="fas fa-check" style="display:inline;padding-right:3px;"></i>Select Caller</p>
<div class="row align-items-start" style="padding-bottom: 5px;">
<div class="col form-check">
<input class="form-check form-check-inline" type="radio" name="callertype" value="Insd">
<label class="form-check-label" for="Insd">caller 1</label>
<input class="form-check form-check-inline" type="radio" name="callertype" value="Clmt">
<label class="form-check-label" for="Clmt">caller 2</label>
<input class="form-check form-check-inline" type="radio" name="callertype" value="Clmt Ins">
<label class="form-check-label" for="Clmt Ins">caller 3</label>
<input class="form-check form-check-inline" type="radio" name="callertype" value="Lawyer">
<label class="form-check-label" for="Lawyer">caller 4</label>
</div>
</div>
<hr style="margin: 0px; padding-bottom: 10px;">
<div class="col form-group row">
<label class="col-3 col-form-label"><i class="fas fa-user" style="display:inline;margin:0;padding:0px;">Name</i></label>
<div class="col-9">
<input type="text" class="form-control" name="name" placeholder="Enter Caller's Name">
</div>
</div>
<div class="col form-group row">
<label class="col-3 col-form-label"><i class="fas fa-phone" style="display:inline;margin:0;padding:0px;">Number</i></label>
<div class="col-9">
<input type="number" class="form-control" name="number" placeholder="Enter Caller's Number">
</div>
</div>
<div class="col form-group row">
<label class="col-3 col-form-label"><i class="fas fa-hashtag" style="display:inline;">Ref</i>: </label>
<div class="col-9">
<input type="text" class="form-control" name="oboref" placeholder="Behalf/*Claim#/*Ref#">
</div>
</div>
<div class="col form-group row">
<label class="col-3 col-form-label" for="inlineFormCustomSelect"><i class="fas fa-question-circle" style="display:inline;margin:0;padding:0px;">RFC</i></label>
<div class="col-9">
<select class="custom-select mr-sm-2" id="inlineFormCustomSelect" name="rfcoption">
<option selected>defaut rfc option</option>
<option name="rfcoption">rfc option 1</option>
<option name="rfcoption">rfc option 2</option>
<option name="rfcoption">rfc option 3</option>
<option name="rfcoption">rfc option 4</option>
</select>
</div>
</div>
<div class="col form-group row">
<label class="col-3 col-form-label"><i class="fas fa-pen-square" style="display:inline;margin:0;padding:0px;">Notes</i></label>
<div class="col-9">
<textarea class="form-control" name="comment" rows="1" col "s="40 " placeholder="Important Information"></textarea>
</div>
<div class="col form-group row">
<label class="col-3 col-form-label" for="inlineFormCustomSelect"><i class="fas fa-star" style="display:inline;padding-right:3px;">Action</i></label>
<div class="col-9"><select class="custom-select mr-sm-2" id="inlineFormCustomSelect" name="csroption">
<option selected>default csr option</option>
<option name="csroption">csr option 1</option>
<option name="csroption">csr option 2</option>
<option name="csroption">csr option 3</option>
<option name="csroption">csr option 4</option>
</select>
<div class="col form-group row">
<label class="col-3 col-form-label text-right" for="inlineFormCustomSelect"><i class="fas fa-address-book" style="display:inline;margin:0;padding:0px;">ADJ</i></label>
<div class="col-9"><select class="custom-select mr-sm-2" id="inlineFormCustomSelect" name="adjuster">
<!-- Beginning Adjuster Selection -->
<option selected>Adjuster</option>
<option name="adjuster">Adjuster 1</option>
<option name="adjuster">Adjuster 2</option>
<option name="adjuster">Adjuster 3</option>
<option name="adjuster">Adjuster 4</option>
</select>
<!-- End Adjuster Selection -->
Copy & Paste Text Below
"; echo "Caller: " . $callertype . "-" . $name . ""; echo "Number: " . $number . "
"; echo "OBO/Claim/Ref#: " . $oboref . "
"; echo "Exposure: " . $exposure . "
"; echo "RFC: " . $rfcoption . "
"; echo "Comments: " . $comment . "
"; echo "CSR Action: Advd adj contact info & " . $csroption . "
"; echo "Adjuster: " . $adjuster . "
"; ?>