Well I had help with this type conversion before
[RESOLVED] help with .php vs .tpl
And I really thought I was starting to get it lol.
Well I have another php page that I am trying to split up into php & tpl
I have found many mistakes that I have mad (missing ; and etc ) but obviously there is at least one (probably way more) syntax error etc.
Can some one see where I have gone wrong?
Thanx.
include_once('db_conn.php');
$sql = "SELECT * FROM `nascar_standings` ORDER BY driver ASC LIMIT 65";
$rs = mysql_query($sql);
$user = "frank";
$i = 0;
$sel_text = "";
$column = '</tr><tr>';
$sel_text .= '<form name='frmChk' action='testsel1.php' method='post'>';
while($row = mysql_fetch_assoc($rs)){
$label = $row['driver'];
$sel_text .= '<td><input type='checkbox' name='chks[]'> $label </td>';
if (++$i % 3 == 0)
{
$sel_text .= $column;
}
}
$sel_text .= '</tr><tr><td align = center><input type='submit' value='Validate & Submit' name='validate' onclick='if(!checkCount()) return false;'></form></td></tr></table>';
$sel_text .= '<script language='javascript'>
function checkCount(){
var count=0;
var inputs=document.frmChk.getElementsByTagName('input');
for(var i=0; i<inputs.length-1; i++){
if(inputs[i].type == 'checkbox' && inputs[i].checked == true)
count++;
}
if(count != 7){
alert('You must select 7 Drivers');
return false;
}
return true;
}
</script>';
$tpl -> AssignArray(array('selteam' => $sel_text));
I thought it might be the Javascript validation, but removed all that it the page still breaks.
Any help will be greatly appreciated.