I Have a standard HTML table saved into a PHP file which I am putting on many webpages, but each webpage is about a different item.
So in my HTML table (in the blanktable.php file, which I include on the webpages) I've put in undefined PHP variables like so:
<table>
<tr>
<td>Item Name:</td>
<td><?php echo "$name"; ?></td>
</tr>
<tr>
<td>Price:</td>
<td><?php echo "$price"; ?></td>
</tr>
<tr>
</table>
What would be the best way to dynamically create my webpages, so all I would have to do is define the variables instead of hardcoding the HTML each time?
You can load $name and $price from your database and then include your blanktable.php.
By this, the table will be filled with the actual values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With