GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Can I create static pages from php reading data out of a mysql db? (https://gfy.com/showthread.php?t=823754)

Kard63 04-23-2008 12:13 AM

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.

V_RocKs 04-23-2008 12:51 AM

I think you are almost there.

Hotrocket 04-23-2008 12:55 AM

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

Adultnet 04-23-2008 12:59 AM

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.. :)

Kard63 04-23-2008 01:39 AM

Quote:

Originally Posted by Hotrocket (Post 14100606)
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

kard63atyahoocom

Hotrocket 04-23-2008 02:12 PM

email sent

Kard63 04-23-2008 04:14 PM

Quote:

Originally Posted by Hotrocket (Post 14103640)
email sent

Thanks man. That script seems to be it but I can't use a script. I have to code it.


Quote:

Originally Posted by Adultnet (Post 14100617)
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.. :)

Thank you. I'm going to go get a pizza and hit you up!

Kard63 04-23-2008 04:15 PM

Are these the two methods you mentioned adultnet
Generate Static HTML Pages From A Database
Create Online - Designing search engine friendly PHP pages

woj 04-23-2008 04:21 PM

Are you sure you need static pages? maybe just some mod_rewrite magic would be good enough?

Sam Granger 04-23-2008 04:25 PM

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]

Kard63 04-23-2008 04:33 PM

Quote:

Originally Posted by woj (Post 14104202)
Are you sure you need static pages? maybe just some mod_rewrite magic would be good enough?

Static might not be the word I'm looking for. I want the extension to be html and I want google to be able to tell no difference when it indexes it.

Bro Media - BANNED FOR LIFE 04-23-2008 05:12 PM

Quote:

Originally Posted by Kard63 (Post 14104256)
Static might not be the word I'm looking for. I want the extension to be html and I want google to be able to tell no difference when it indexes it.

RewriteRule ^articles/([^/]+).html$ index.php?article=$1

BLAM!!

Kard63 04-23-2008 05:25 PM

Quote:

Originally Posted by Jaysin (Post 14104441)
RewriteRule ^articles/([^/]+).html$ index.php?article=$1

BLAM!!

Umm I donut know what that is but is that 1 line really the answer to everything I want?'

Bro Media - BANNED FOR LIFE 04-23-2008 05:27 PM

Quote:

Originally Posted by Kard63 (Post 14104530)
Umm I donut know what that is but is that 1 line really the answer to everything I want?'

its htaccess, what it does is it takes yoursite.com/articles/some-title-here.html and the server reads index.php?article=some-title-here

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

ScriptWorkz 04-23-2008 05:33 PM

Editted: What they said ^^

Kard63 04-23-2008 07:51 PM

Quote:

Originally Posted by Jaysin (Post 14104541)
its htaccess, what it does is it takes yoursite.com/articles/some-title-here.html and the server reads index.php?article=some-title-here

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

and google is clueless?

brandonstills 04-24-2008 12:47 AM

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.

Bro Media - BANNED FOR LIFE 04-24-2008 11:28 AM

Quote:

Originally Posted by Kard63 (Post 14105053)
and google is clueless?

absolutely!

gornyhuy 04-24-2008 11:34 AM

imho its better to crank out static pages. Easier on the server, cleaner on the SEO, and just as easy.

skrinkladoo 04-24-2008 05:03 PM

Jaysin's right - .htaccess is the easy way

skrinkladoo 04-24-2008 05:09 PM

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