Converting html to php

Discussion in 'HTML & Website Design' started by sweetangel, Feb 17, 2007.

  1. #1
    How do you convert html site to become php? Can I just save it as .php? How about editing?same as html?
     
    sweetangel, Feb 17, 2007 IP
  2. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #2
    I think, you will need to just change .htm/.html file name to .php
     
    MeetHere, Feb 17, 2007 IP
  3. sweetangel

    sweetangel Peon

    Messages:
    1,383
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #3
    How about editing your site? Just the same codes with html?
     
    sweetangel, Feb 17, 2007 IP
  4. Dominicc2003

    Dominicc2003 Peon

    Messages:
    853
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Dominicc2003, Feb 17, 2007 IP
  5. toby

    toby Notable Member

    Messages:
    6,923
    Likes Received:
    269
    Best Answers:
    0
    Trophy Points:
    285
    #5
    it depends on what you want to edit? do you need database connection wise? If yes,you will need to learn basic to advance php programming language. else, just change the extention to .php will do the trick.
     
    toby, Feb 17, 2007 IP
  6. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #6
    in short, to convert from html to php, simply rename the file name with a php extension. however, i cannot see why one would even want to do this. if there is no server side processing required, i would think that .htm/.html extension is preferrable.
     
    daboss, Feb 17, 2007 IP
  7. 8everything

    8everything Peon

    Messages:
    16,350
    Likes Received:
    903
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Oh no, that wouldn't work the same way.. I mean it WILL show up the same even if you place it in a .php file.

    The best way is to learn it (the basics is not too hard). Were you thinking about making PHP tables (spliting the header, navigation, content into seperate files so they're easier to edit later?). Or programming? If neither, I don't see why you can't just stick with HTML;) But if you have a PHP file (with lets say.. a contact page) you can just code HTML into that file.
     
    8everything, Feb 17, 2007 IP
  8. coolsaint

    coolsaint Banned

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I wish you can use html to any code Converter. That will automatically convert the html tags to php echo. Handy but it will make lots of echo in every line that is worst.
     
    coolsaint, Feb 17, 2007 IP
  9. 8everything

    8everything Peon

    Messages:
    16,350
    Likes Received:
    903
    Best Answers:
    0
    Trophy Points:
    0
    #9
    That would be great, but I looked around the net for some.. and tried them but they didn't work:rolleyes: Especially if you have HTML tables and want PHP tables, they won't split it up into pages for you.. I think using those convertors just make your codes look messy and worse to edit when you need to:rolleyes:
     
    8everything, Feb 17, 2007 IP
  10. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #10
    It really depends what you are looking for. If you want to echo out an help code you can juse use "echo ("html code here");" or you can just change the extension to .php
     
    prilep, Feb 17, 2007 IP
  11. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #11
    I'm not sure why you would like to do that...
    You can use regular html tags on .PHP pages as well.
    ------
    <?php
    echo "<h1>My name</h1>";
    ?>
    <b>Some text here.</b>
    ------

    is same as:
    ---
    <h1>My name</h1>
    <b>Some text here</b>
    -----

    Or did I understand you wrong? :)
    Bye
     
    JEET, Feb 17, 2007 IP
  12. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,200
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #12
    If you need to run php code there's a line you can put in the htaccess file to process php on html pages. Saves you having to convert all the pages!
     
    dcristo, Feb 17, 2007 IP
  13. GHOwner

    GHOwner Peon

    Messages:
    81
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    PHP is only used as a server-side output (in a sense). HTML and the likes will work fine in a .php file. What exactly do you want to change by going into PHP? Easier content presentation and updating?
     
    GHOwner, Feb 17, 2007 IP