Hello:
I'm running a script which is resulting with one variable as an Undefined Index. The error message is:
Undefined index: intcredit in C:\Inetpub\fullfocus\AtlantaMtgPlace\loan_options.php on line 23
I do not understand why this message is appearing. The form which contains the answer to this question is a radio button. I have two additional radio button questions right above it and their values are coming through to the script without a problem. For some reason, my script doesn't like the variable "intcredit".
Can someone help me out? I copied and pasted one of the other radio buttons and modified it for this variable.
This is the script which contains the form.
<?php
include('header.html');
require_once ('mysql_connect.php');
if (isset($_POST['submitted'])) {
$errors = array();
//validate form data
if (empty($_POST['downpmt'])) {
$errors[] = 'Please enter a down payment.';
} else {
$_SESSION['downpmt'] = escape_data($_POST['downpmt']);
}
}
$_SESSION['loan_amount'] = 0;
$_SESSION['cltv'] = 0;
$_SESSION['ltv'] = 0;
$_SESSION['loan_amount'] = $_SESSION['purchaseprice'] - $_SESSION['downpmt'];
$_SESSION['cltv'] = $_SESSION['loan_amount'] / $_SESSION['purchaseprice'];
$_SESSION['ltv'] = $_SESSION['cltv'];
?>
<p><b>Your Information:</b></p>
<table>
<tr><td><b>Purchase Price:</b></td><td> </td><td><?php echo number_format($_SESSION['purchaseprice'],2); ?></td></tr>
<tr><td><b>Planned Closing Date:</b></td><td> </td><td><?php echo $_SESSION['date']; ?></td></tr>
<tr><td><b>Location:</b></td><td> </td><td><?php echo $_SESSION['location']; ?></td></tr>
<tr><td><b>Down Payment:</b></td><td> </td><td><?php echo number_format($_SESSION['downpmt'],2); ?></td></tr>
<tr><td><b>Loan Amount:</b></td><td> </td><td><?php echo number_format($_SESSION['loan_amount'],2); ?></td></tr>
<tr><td><b>CLTV:</b></td><td> </td><td><?php echo number_format($_SESSION['cltv'] * 100,2); ?>%</td></tr>
<tr><td><b>LTV:</b></td><td> </td><td><?php echo number_format($_SESSION['ltv'] * 100,2); ?>%</td></tr>
</table>
<hr>
<p>Please answer the following questions to see your loan options.</p>
<form name="my_form" id="my_form" action="searchrates.php" method="post">
<p><label for="propuse">Property use:</label>
<select name="propuse" size="1"">
<option value="Home">as a Home</option></SELECT></p>
<p><label for="proptype">Property type:</label>
<select name=proptype>
<option value="Single Family">Single Family Residence</option>
<option value="Condo">Condominium-less than 4 stories</option></select></p>
<p><label for="bincome">Borrower<br>Gross Monthly Income (before taxes):</label> <input type="text" name="bincome" size="15" maxlength="15" /></p>
<p> </p>
<p><label for="cincome">Co-Borrower<br>Gross Monthly Income (before taxes):</label> <input type="text" name="cincome" size="15" maxlength="15" /></p>
<p> </p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><b>Credit History:</b> </td>
<td>
<select name="fico">
<option value=""></option>
<option value=720>Excellent (over 720) </option>
<option value=700>Very Good (700-719)</option>
<option value=680>Good (680-699)</option>
<option value=620>Fair (620-679)</option>
<option value=619>Poor (below 619)</option>
</select>
</td>
<td width=25><b> OR</b></td><td> </td>
<td><b>Approximate credit score:</b> </td>
<td><input type=text name=ficonum size=3 maxlength=3 value=""></td></tr>
</table>
<p> </p>
<tr><td colspan=2><p style="line-height: 20px;"><b>Are you willing to document your income during the loan process?</b><br>
<INPUT TYPE=RADIO name=docincome VALUE=Yes checked> <b>I will document</b> my income for the lender.<BR>
<INPUT TYPE=RADIO name=docincome VALUE=No > <b>I will not document</b> my income. I understand stated loans are subject to higher interest
rates.</p></td></tr>
<tr><td colspan=2><p style="line-height: 20px;"><b>Do you plan to escrow?</b><br>
<INPUT TYPE=RADIO NAME=escrow VALUE=Yes checked> Yes, I will escrow.<BR>
<INPUT TYPE=RADIO NAME=escrow VALUE=No > No, I will not escrow.</p></td></tr>
[COLOR="Red"]<tr><td colspan=2><p style="line-height: 20px;"><b>If closing on or before the 5th of the month, do you want an interest credit? (First mortgage payment will be at the beginning of the next month. Ex: closing date is 6/5/2007, first payment is on 7/1/2007)</b><br>
<INPUT TYPE=RADIO NAME=intcredit VALUE=Yes checked> Yes, I want an interest credit.<BR>
<INPUT TYPE=RADIO NAME=intcredit VALUE=No > No, I do not want an interest credit.</p></td></tr>[/COLOR]
<tr><td><input type="submit" name="btnSubmit" id="btnSubmit" value="Submit to see loan options for my scenario" class="btn" onfocus="this.blur()" />
<input type="hidden" name="submitted" value="TRUE" /></td></tr></table>
</form>
<script language="JavaScript" type="text/javascript">
<!--
var fields = document.my_form.elements;
fields["fico"].onblur = function(){
if(this.selectedIndex > 0){fields["ficonum"].disabled = "disabled";} else{fields["ficonum"].disabled = false;} }
fields["ficonum"].onblur = function(){
if(this.value != ""){fields["fico"].disabled = "disabled";} else{fields["fico"].disabled = false;} }
function reSet(){
fields["fico"].disabled = false;
fields["ficonum"].disabled = false;
}
document.my_form.onreset = reSet;
document.my_form.onsubmit = function(){ if(fields["fico"].selectedIndex > 0 && fields["ficonum"].value != ""){window.alert("You must choose only one of those two variants!"); return false;} else{return true;} } //--> </script> </body> </html>
This script processes the form. I only included the top half of the script which is a bunch of echo statements. The value for "intcredit" is not appearing in the echo statement. The rest of the script is useless if I can't see the value for this variable.
<?php
include('header.html');
require_once('mysql_connect.php');
echo "Purchase Price: $_SESSION[purchaseprice]<br>";
echo "Down Payment: $_SESSION[downpmt]<br>";
echo "Loan Amount: $_SESSION[loan_amount]<br>";
echo "Closing Date: $_SESSION[date]<br>";
echo "Days in Month: $_SESSION[days_in_month]<br>";
echo "Days Left in Month: $_SESSION[days_left_in_month]<br>";
echo "LTV: $_SESSION[ltv]<br>";
echo "CLTV: $_SESSION[cltv]<br>";
echo "Property Use: $_SESSION[propuse]<br>";
echo "Property Type: $_SESSION[proptype]<br>";
echo "Borrower Income: $_SESSION[bincome]<br>";
echo "Co-Borrower Income: $_SESSION[cincome]<br>";
echo "FICO: $_SESSION[fico]<br>";
echo "FICO Score: $_SESSION[ficonum]<br>";
echo "Document Income: $_SESSION[docincome]<br>";
echo "Escrow: $_SESSION[escrow]<br>";
[COLOR="red"]echo "Interest Credit: $_SESSION[intcredit]<br>";[/COLOR]echo "<hr>";
As you can see the radio button code is identical to the other two and the echo statement is identical to the two above.
Can someone help me out? Thank you.