Noob question about converting from static HTML to php

Discussion in 'PHP' started by kiplarson, Aug 13, 2007.

  1. #1
    I have a couple static html sites that I used templates for and I want to convert them to php (for an advertising program).

    Would it be as simple as just saving the file extension as .php instead of html in a file editor or would that not work? (I'm leaning towards that won't work)

    In any case, if the above won't work what would you recommend? Thanks in advance.

    One of the sites in question is GamingFonts.com (in my sig)
     
    kiplarson, Aug 13, 2007 IP
  2. Grumps

    Grumps Peon

    Messages:
    592
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There is no point making a page extension to .php without having any php based content. Extension wont affect anything.

    You can just include a area of code for your ads blog. Save all your ads in one php file.

    Then place the following code in your existing page to call for that file. (Eg: ads.php)

    
    <?php
    include('ads.php');
    ?>
    PHP:
    Just that simple.
     
    Grumps, Aug 13, 2007 IP
  3. bsklep

    bsklep Well-Known Member

    Messages:
    2,122
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    165
    #3
    What? --> Grumps

    No When You want use "include" your file must have extension: .php

    Change extensions to .php, than When You want to use some php code just use:


    <?

    Your code


    ?>


    Cheers
     
    bsklep, Aug 13, 2007 IP
  4. jakomo

    jakomo Well-Known Member

    Messages:
    4,262
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    138
    #4
    Hello,
    Yes you can exchange the extension html to php, but remeber to redirect your old html pages to the new one with extension php. Because maybe in the search engine there are html pages...
    I dont understand if you can understand me...

    Best,
    Jakomo
     
    jakomo, Aug 13, 2007 IP
  5. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Or ,if you have permission, you can makethe server parse all the HTML files as PHP using .htaccess

    
    AddType application/x-httpd-php .htm
    AddType application/x-httpd-php .html
    
    Code (markup):
    ~
    Thomas
     
    coderlinks, Aug 14, 2007 IP
  6. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well, the two sites I'm talking about are these:

    GamingFonts.com
    and
    NESgaming.com

    I think that I might just take the content and put them into wordpress blogs and then I don't have to deal with figuring out how to do php stuff.
     
    kiplarson, Aug 20, 2007 IP