![]() |
Can I create static pages from php reading data out of a mysql db?
Can I have php make a static html page for every entry in a certain field? I have a 'subject' field and I would like it to make a 'subject'.html page for every subject in every row. Can it be done?
I read there was a way to mask a dynamic page to do that but you have to manually make and name each html page for each subject on the server and chmod it to 666. Then you can populate the page with info from the DB. Thats not what I want. I want the page to be made. |
I think you are almost there.
|
yep it can be done..I have a link to a free script w/ tutorial and examples but its on another webmaster forum so cant post it here..gimmie an email and I'll send it on over to ya.
sry no icq |
yes can be done,
Basicly you can have 2 options : 1. Force the php script to connect to the database go all over the topics you got there and create the html pages for you based on a layout.(Dynamic if setup as batch/ static if not) 2. Force the pages to be auto created once a reply is added to the database by running the the same lines just for the recent topic. (Dynamic) if you need help with setup you can hit me up at icq 502189.. :) |
Quote:
|
email sent
|
Quote:
Quote:
|
Are these the two methods you mentioned adultnet
Generate Static HTML Pages From A Database Create Online - Designing search engine friendly PHP pages |
Are you sure you need static pages? maybe just some mod_rewrite magic would be good enough?
|
I am off to bed but I can program something like this in no time for free. If you dont have any luck today, email me: [email protected]
|
Quote:
|
Quote:
BLAM!! |
Quote:
|
Quote:
i use it on my sites http://www.fukbag.com/articles/celeb...ed-to-you.html is actually pulling http://www.fukbag.com/index.php?cat=...appened-to-you |
Editted: What they said ^^
|
Quote:
|
Are you wanting to do this to make the URL's look nicer or are you wanting to do this for performance reasons? For the former, there are numerous ways to go about making dynamic URL's that can be parsed any way you like. For the latter, you simply need some code that goes through the database entries and writes a file for each entry. Both are fairly trivial. Any decent programmer will be able to help you out.
|
Quote:
|
imho its better to crank out static pages. Easier on the server, cleaner on the SEO, and just as easy.
|
Jaysin's right - .htaccess is the easy way
|
try adding this to the .htaccess
RewriteEngine on RewriteBase / RewriteRule ^([^/]*)\.html$ $1.php?%{QUERY_STRING} [NC] make sure the mod_rewrite is enabled on the apache config (or ask your hosting company) |
All times are GMT -7. The time now is 01:07 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123