Can I create static pages from php reading data out of a mysql db?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kard63
    Confirmed User
    • Nov 2003
    • 8944

    #1

    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
    Damn Right I Kiss Ass!
    • Nov 2003
    • 32467

    #2
    I think you are almost there.

    Comment

    • Hotrocket
      Confirmed User
      • May 2004
      • 1327

      #3
      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

      Comment

      • Adultnet
        Confirmed User
        • Sep 2003
        • 8713

        #4
        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..


        TrafficCashGold Paying Webmasters Since 1996!

        Awesome Conversions! Fast Weekly Payments! Over 125 Tours!

        Comment

        • Kard63
          Confirmed User
          • Nov 2003
          • 8944

          #5
          Originally posted by Hotrocket
          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

          Comment

          • Hotrocket
            Confirmed User
            • May 2004
            • 1327

            #6
            email sent

            Comment

            • Kard63
              Confirmed User
              • Nov 2003
              • 8944

              #7
              Originally posted by Hotrocket
              email sent
              Thanks man. That script seems to be it but I can't use a script. I have to code it.


              Originally posted by Adultnet
              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!

              Comment

              • Kard63
                Confirmed User
                • Nov 2003
                • 8944

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

                Comment

                • woj
                  <&(©¿©)&>
                  • Jul 2002
                  • 47880

                  #9
                  Are you sure you need static pages? maybe just some mod_rewrite magic would be good enough?
                  Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
                  Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
                  Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

                  Comment

                  • Sam Granger
                    Confirmed User
                    • Dec 2004
                    • 3958

                    #10
                    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]

                    $35-40 Per Signup, 60-70% Rev Share, over 80 Sites, Exclusive Sites, tons of free content
                    14,000+ Free hosted Galleries, RSS feeds, Domain Hosting, Embedded Flash Movies
                    Join Fetish Hits now!
                    ICQ: 358652230

                    Comment

                    • Kard63
                      Confirmed User
                      • Nov 2003
                      • 8944

                      #11
                      Originally posted by woj
                      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.

                      Comment

                      • Bro Media - BANNED FOR LIFE
                        MOBILE PORN: IMOBILEPORN
                        • Jan 2004
                        • 16502

                        #12
                        Originally posted by Kard63
                        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!!

                        Comment

                        • Kard63
                          Confirmed User
                          • Nov 2003
                          • 8944

                          #13
                          Originally posted by Jaysin
                          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?'

                          Comment

                          • Bro Media - BANNED FOR LIFE
                            MOBILE PORN: IMOBILEPORN
                            • Jan 2004
                            • 16502

                            #14
                            Originally posted by Kard63
                            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

                            Comment

                            • ScriptWorkz
                              Confirmed User
                              • Jul 2007
                              • 274

                              #15
                              Editted: What they said ^^
                              Last edited by ScriptWorkz; 04-23-2008, 04:34 PM. Reason: more simply explained above

                              Comment

                              • Kard63
                                Confirmed User
                                • Nov 2003
                                • 8944

                                #16
                                Originally posted by Jaysin
                                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?

                                Comment

                                • brandonstills
                                  Confirmed User
                                  • Dec 2007
                                  • 1964

                                  #17
                                  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.

                                  Brandon Stills
                                  Industry and programming veteran
                                  [email protected] | skype: brandonstills | ICQ #495-171-318

                                  Comment

                                  • Bro Media - BANNED FOR LIFE
                                    MOBILE PORN: IMOBILEPORN
                                    • Jan 2004
                                    • 16502

                                    #18
                                    Originally posted by Kard63
                                    and google is clueless?
                                    absolutely!

                                    Comment

                                    • gornyhuy
                                      Chafed.
                                      • May 2002
                                      • 18041

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

                                      icq:159548293

                                      Comment

                                      • skrinkladoo
                                        Confirmed User
                                        • Oct 2007
                                        • 629

                                        #20
                                        Jaysin's right - .htaccess is the easy way
                                        *** Andrew Love ***

                                        Services: (1) Web Design, (2) Graphic Design, (3) E-commerce, (4) Database Development,
                                        (5) Web Analytics, (6) Targeted Lead Generation, (7) Marketing and Consulting

                                        Mainstream: Successful Website Landing Page Design | ICQ: 360-83-9627

                                        Comment

                                        • skrinkladoo
                                          Confirmed User
                                          • Oct 2007
                                          • 629

                                          #21
                                          try adding this to the .htaccess



                                          RewriteEngine on
                                          RewriteBase /
                                          RewriteRule ^([^/]*)\.html$ $1.php?&#37;{QUERY_STRING} [NC]



                                          make sure the mod_rewrite is enabled on the apache config (or ask your hosting company)
                                          Last edited by skrinkladoo; 04-24-2008, 04:10 PM. Reason: typo
                                          *** Andrew Love ***

                                          Services: (1) Web Design, (2) Graphic Design, (3) E-commerce, (4) Database Development,
                                          (5) Web Analytics, (6) Targeted Lead Generation, (7) Marketing and Consulting

                                          Mainstream: Successful Website Landing Page Design | ICQ: 360-83-9627

                                          Comment

                                          Working...