Всем привет, я новичок в php. Не могу понять как заполнить таблицу html при помощи формы.
<!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> table{ border:1px solid black; margin-top:30px } td,tr{ border:1px solid black; } </style> </head> <body> <form action="form.php" method="POST"> A <input type="text" name="A"> B <input type="text" name="B"> <input type="submit" name="C" value="ok"> </form> <? $ html="<table>"; $ html.="<tr>"; $ html.="<td>"; $ html.=$ _POST['A']; $ html.="</td>"; $ html.="<td>"; $ html.=$ _POST['B']; $ html.="</td>"; $ html.="</tr>"; $ html.="</table>"; echo $ html; ?> </body> </html>
Делаю так, но понимаю что это не правильно ведь страница обновляется, подскажите как реализовать такую задачу?