Ok so I have a table generating input fields with dynamic names based upon the previous selection made on another page. It displays the relational children from the previous parent categories, however I have now bumped into a new problem. It seems that the markup although working is not appearing in the page source. Could anyone lend a suggestion as to why this could be the case:
The PHP is as follows:
Bear in mind that the <form> tags are outside of this script they display.
The output is fine the form is display it's content, but within the markup all you can see is this:
Well line the "undefined" on line 32 happens to be a variable I have defined called:
any ideas?
The PHP is as follows:
Bear in mind that the <form> tags are outside of this script they display.
PHP:
$c = 0;
foreach($_POST as $k => $v){
if($v == 'present'){
$pre = 'percentage_';
$post = $pre.$k;
$val[$k] = $_POST[$post]; // store all present percentage elements in an array.
$posts[$c] = $k; // Make an array of posts.
$percent[$k] = $_POST[$post]; // Get the percentage of the selected values.
$c++;
}
}
/*
* Count the total number of references within the array so that, which is relational to the total number
* of elements selected on the previous page.
*/
$max = count($posts);
for($i=0;$i<$max;$i++){
$sql = mysql_query("SELECT * FROM default_analysis_list_sub WHERE element = '".$posts[$i]."' ");
$m = mysql_num_rows($sql); // Count the number of rows for the current itteration element.
for($j = 0; $j<$m; $j++){
$child = mysql_result($sql, $j, 'sub_element');
$parent = mysql_result($sql, $j, 'element');
if($j == 0){
echo "</fieldset><fieldset><legend><b>".$parent.": ".$percent[$parent]."%</b></legend>";
echo $child."<input type=\"radio\" name=\"".$child."\" value=\"present\"> Yes <input type=\"radio\" name=\"".$child."\" value=\"absent\" checked> No <input type=\"text\" name=\"percentage_".$child."\" />% of EQF<br />";
}
if($j > 0){
echo $child."<input type=\"radio\" name=\"".$child."\" value=\"present\"> Yes <input type=\"radio\" name=\"".$child."\" value=\"absent\" checked> No <input type=\"text\" name=\"percentage_".$child."\" />% of EQF<br />";
}
}
}
The output is fine the form is display it's content, but within the markup all you can see is this:
Code:
<form action="default_analysis_c.php?building_name=mike_building&project_name=mike_project&survey_name=Default&quality=3" method="post">
<br />
<b>Notice</b>: Unde in <b>/Applications/MAMP/htdocs/combicycle/default_analysis_b.php</b> on line <b>32</b><br />
</fieldset><br /><input type="submit" />
</form>
Well line the "undefined" on line 32 happens to be a variable I have defined called:
PHP:
$max = count($posts);
any ideas?