My PHP script gets the data from MYSQL DB and shows the data dynamically using pagination. The hyper link is created for each title linking to title page with .html extension.But i don't want to create static html files for each title link .When the users clicks the link ,it shows the .html file with the title name but that is not created as static page.I want to create .html file dynamically and get the data from mySQL to display on the dymaic html page for each title link.
I know we can use the file stream to dynamically create .html file on the hosting server.But when i need to have a generic php file that i need to link to all the titles and then redirect to the title page.
But i don't want to do this way.On the fly when user clicks titel link ., get the information from my SQL DB create and show the title page in the browsre.
Help Needed! PHP Code to dynamically create .html file
Moderator: General Moderators
Re: Help Needed! PHP Code to dynamically create .html file
There's a thing called URL rewriting. It lets you tell the server that the requested file should be something else.
Like you can rewrite /path/to/file.html to /display.php?url=path/to/file.html, so you have one PHP page to handle certain requests.
So what I need to know:
- What web server are you using (like Apache or IIS)?
- What kind of URL are you using for the HTML files?
- What PHP file to do you want to use to display them dynamically?
Like you can rewrite /path/to/file.html to /display.php?url=path/to/file.html, so you have one PHP page to handle certain requests.
So what I need to know:
- What web server are you using (like Apache or IIS)?
- What kind of URL are you using for the HTML files?
- What PHP file to do you want to use to display them dynamically?