Jump to content


This topic is now archived and is closed to further replies.


How to generate HTML file from PHP code

Recommended Posts


I am developing an article based website. I want each article to be indexed in search engines. My URL becomes like this.

http://www.pbm-biz.com/wow/articleDetails.php?id=3&&title=Human Psychology

I want this page to be saved in this way.


My first Question is, Is this the right approach ?
If yes, How to generate the HTML file with each article. Any link to knowledge base is welcome or personal experience is also appreciated.

If this is not the right approach, what is the best thing to do.

I really appreciate your help and anxiously waiting for your reply.



Share this post

Link to post
Share on other sites
Last I remembered.. search engines do index pages that are generated via databases.  Though I do understand that actual .html files would be easier for it to be crawled.

I think it's fwrite() you want to look at if you're wanting to create the actual .html file. Just output the code to variables and then write those to the file.

I do know there have been people to do what you want.  I just can't remember where/how they did it, but I know it can be done. You have to parse the URL for the file you wish to serve.  Where mydomain.com/article/ThisThing101/1 usually meant something like mydomain.com/article.php?name=ThisThing101&page=1

Sorry I could not be any more help.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.