For example, there is an addnews.php page with a form for adding news to the site. There is an editnews.php page with the same form for editing a specific news. How do I make one form for both pages so as not to duplicate? Suppose if on the addnews.php page I need to remove / add some kind of thread field, I will have to change the editnews.php page too ... and this somehow does not work out nicely ... 21st century fsyo-currents)
Of course, you can do this:
<input type="text" name="title" value="<?php echo !empty($title) ? $title : null; ?>" />
But this is not very beautiful ... Maybe there is a more flexible way?