I have a page which displays info about a property, based on the unique ID from the url, searching the mysql database for that ID, getting all the info from that row etc, fairly standard really.
I was wondering if/how I can 'create' a html page for each database row, as I'm assuming this would be better for SEO? Having multiple pages with keywords on rather than one dynamic page?
My properties are added to the database by a form/ upload system on the site, I was thinking creating the page on upload might be easiest, but am open to suggestions!
When a browser requests a PHP page, the web server sends the page to the PHP engine, a piece of software that runs on the server. This processes is the PHP code and merges the output with the HTML. And it's this merged output that's sent back to the browser.
PHP and HTML interact a lot: PHP can generate HTML, and HTML can pass information to PHP. Before reading these faqs, it's important you learn how to retrieve variables from external sources.
Just in case someone wants to generate/create actual HTML
file...
$myFile = "filename.html"; // or .php
$fh = fopen($myFile, 'w'); // or die("error");
$stringData = "your html code php code goes here";
fwrite($fh, $stringData);
fclose($fh);
Enjoy!
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