print"<html><body>"; ////creating html and body tags
print "<form name='frm1' action='count.php' method='post'>"; ///creating form for posting
$count=1; //a counter to increment the rows
print "<div id='divisions'>"; ///creating division where the rows will be inserted
print "<table border=0 border-style='ridge' width=750 align='center'>"; /// first table
print "<tr><td></td></tr>";
print "<tr><td></td><td style=border-style:none align='left'>";
print "<input type='text' name=row1".$count." size='20' maxlength='100'>";//row11 creating first row with the names as row
print "</td>";
print "<td style=border-style:none align='right'>";
print "<input type=text name=row2".$count." size='10' maxlength='10'>";//row21
print "</td>";
print "<td style=border-style:none align='right'>";
print "<input type=text name=row3".$count." size='10' maxlength='10'>";//row31
print "</td><td style=border-style:none align='left'><a href='javascript:add(".++$count.")'>+</a></td></tr>"; /// hyperlink and counter to add rows using javascript
print "</table>"; ///end of first table
print "</div>"; //// division gets over
print "<table border=0 width=740 align='center'><tr><td colspan=5 align='center'><input type='submit'></td></tr></table>"; // table & submit buttonthird table end
print "</form>"; //end of form
print"</body></html>"; //end of html and body
?>
matthew waygood wrote :1340
Nice little bit of script, but thought it a bit stange you printed the first form when you have the javascript there to do it for you. Also no need for the PHP bit, as you can use javascript to hold the count.
Heres the re-write for you:-