I have following errors in below coding.
Undefined variables: fname,focu,foad,ftp,fmf,mname,mocu,moad,mtp,mmf,gname,gocu,goadd,gtp,gmf in C:\wamp\www\Student registration\manage studnt parent details\manageStudentRegistrationParentDetailsForm.php
Code
<?php
$query="SELECT state,name,occupation,office_address,office_telephone,mobile_number FROM parent_info
where admission_no='$admission_no'";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
$first=$row['state'];
if($first=='father'){
$fname=$row['name'];
$focu=$row['occupation'];
$foadd=$row['office_address'];
$ftp=$row['office_telephone'];
$fmf=$row['mobile_number'];
}
if($first=='mother'){
$mname=$row['name'];
$mocu=$row['occupation'];
$moadd=$row['office_address'];
$mtp=$row['office_telephone'];
$mmf=$row['mobile_number'];
}
if($first=='guardians'){
$gname=$row['name'];
$gocu=$row['occupation'];
$goadd=$row['office_address'];
$gtp=$row['office_telephone'];
$gmf=$row['mobile_number'];
}
}
?>
----
----
<tr>
<td> </td>
<td colspan="5"><h3>
<label><strong>Parents/Guardian information</strong></label>
<strong> </strong></h3></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><label>Admission No</label> </td>
<td colspan="2" align="left"><?php echo $admission_no ;?></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<input type="checkbox" name="checkbox" id="checkbox" <?php if($fname!=null){ ?> checked="checked" <?php }?> onclick="father()" />
<label>fathers details</label></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label> Name</label> </td>
<td><input type="text" name="Name1" id="textfield" value="[B]<?php echo $fname; ?>[/B]" disabled="disabled" /></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Occupation</label> </td>
<td>
<input type="text" name="Occupation1" id="textfield2" value="[B]<?php echo $focu; ?>[/B]" disabled="disabled"/>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Office Address</label> </td>
<td>
<textarea name="Office_Address1" id="office_address" cols="45" rows="5" disabled="disabled">[B]<?php echo $foadd; ?>[/B]</textarea>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Office Telephone Number</label>
</td>
<td>
<input type="text" name="Office_tel1" id="textfield4" value="[B]<?php echo $ftp; ?>[/B]" disabled="disabled" />
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Mobile Phone Number</label></td>
<td>
<input type="text" name="Mobile_pho1" id="textfield5" value="[B]<?php echo $fmf; ?>[/B]" disabled="disabled" />
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<input type="checkbox" name="checkbox2" id="checkbox2" <?php if($mname!=null){ ?> checked="checked" <?php }?> onclick="mother()" />
<label>Mothers details</label></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label> Name</label> </td>
<td>
<input type="text" name="Name2" id="textfield3" value="[B]<?php echo $mname; ?>[/B]" disabled="disabled"/>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Occupation</label> </td>
<td>
<input type="text" name="Occupation2" id="textfield7" value="[B]<?php echo $mocu; ?>[/B]" disabled="disabled"/>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Office Address</label> </td>
<td>
<textarea name="Office_Address2" id="textarea" cols="45" rows="5" disabled="disabled">[B]<?php echo $moadd; ?>[/B]</textarea>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Office Telephone Number</label> </td>
<td>
<input type="text" name="Office_tel2" id="textfield8" value="[B]<?php echo $mtp; ?>[/B]" disabled="disabled" />
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Mobile Phone Number</label> </td>
<td>
<input type="text" name="Mobile_pho2" id="textfield9" value="[B]<?php echo $mmf; ?>[/B]" disabled="disabled" />
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<input type="checkbox" name="checkbox3" id="checkbox3" <?php if($gname!=null){ ?> checked="checked" <?php }?> onclick="Guardian()"/>
<label>Guardian details</label></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label> Name</label> </td>
<td>
<input type="text" name="Name3" id="textfield6" value="[B]<?php echo $gname; ?>[/B]" disabled="disabled"/>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Occupation</label> </td>
<td>
<input type="text" name="Occupation3" id="textfield10" value="[B]<?php echo $gocu; ?>[/B]" disabled="disabled"/>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Office Address</label> </td>
<td>
<textarea name="Office_Address3" id="textarea2" cols="45" rows="5" disabled="disabled">[B]<?php echo $goadd; ?>[/B]</textarea>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Office Telephone Number</label> </td>
<td>
<input type="text" name="Office_tel3" id="textfield11" value="[B]<?php echo $gtp; ?>[/B]" disabled="disabled"/>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><label>Mobile Phone Number</label> </td>
<td>
<input type="text" name="Mobile_pho3" id="textfield12" value="[B]<?php echo $gmf; ?>[/B]" disabled="disabled" />
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
<td></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
<td>
<input type="submit" name="button" id="button" value="Save" />
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<p> </p>
<p> </p></td>
</tr>