How to convert HTML/CSS to PHP

Discussion in 'PHP' started by saturn100, May 22, 2010.

  1. #1
    I posted the other a question the other day about a form problem i had
    I have justed fixed it
    It turns out the index page has to be index.php

    however I have designed the site using HTML/CSS
    Is there any way to convert the page and keep the design

    Thanks
     
    saturn100, May 22, 2010 IP
  2. metabinltd

    metabinltd Well-Known Member

    Messages:
    146
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #2
    Rename .html to .php - that should work
     
    metabinltd, May 22, 2010 IP
  3. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yep - php is just the same as html, only anything between <?php and ?> are parsed by the php interpreter, and the output from that code is put in it's place in the same location as the <?php ?> block of code was

    example
    
    <html>
    <head>
        <title><?php echo 'This is the title'; ?></title>
    </head>
    <body>
        <p>The date is <?php echo date('Y-m-d'); ?></p>
    </body>
    </html>
    
    PHP:
    will output
    
    <html>
    <head>
        <title>This is the title</title>
    </head>
    <body>
        <p>The date is 2010-05-23</p>
    </body>
    </html>
    
    HTML:
     
    JAY6390, May 22, 2010 IP
  4. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #4
    jay6390 +1
     
    bartolay13, May 23, 2010 IP