What free program will change HTML to PHP

Discussion in 'Programming' started by goy, Oct 9, 2010.

  1. goy

    goy Well-Known Member

    Messages:
    1,010
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    #21
    The purpose will be i need to run a php script on the pages for ads and meta but now they are all in HTML.

    Active Frost yes i am trying to do that but it is 200 000 pages
     
    goy, Nov 7, 2010 IP
  2. wing

    wing Active Member

    Messages:
    210
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    58
    #22
    If your site is on a Apache server you don't have to change the extension, this line:
    AddType application/x-httpd-php .html
    Code (markup):
    in a .htaccess file will make phpcode inside your html files parsed by the php interpreter.

    If you are using windows, you can download WinSCP and use the putty or telnet window and change the extension for all files in a directory with: rename .html .php *.html
    But that only works if you have ssh or telnet access.

    Or have look at this example from the manual on how to write a php script that does the job for you.
     
    Last edited: Nov 8, 2010
    wing, Nov 8, 2010 IP
  3. goy

    goy Well-Known Member

    Messages:
    1,010
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    #23
    We tried the htacces file but the php code that change the file name never think about it, i will check if it works.
     
    goy, Nov 9, 2010 IP
  4. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #24
    So basically you have however many html pages and you need to add a small amount of php code to each these pages and rename them to .php so that they execute on the server??? If I understand correctly then this can be done fairly easily.. if there is links to any of these pages then they would also have to be changed..
     
    camjohnson95, Nov 9, 2010 IP
  5. goy

    goy Well-Known Member

    Messages:
    1,010
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    #25
    I tried to do that as you told me but it wont work. I will fix a copy of them and upload for you
     
    goy, Nov 16, 2010 IP
  6. matessim

    matessim Active Member

    Messages:
    514
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    70
    #26
    don't blame people for giving incorrect answers when the question is vague,
    From what i understand, you need a bulk change of file extension from .html to .php, not to change the language, thats a totally different question.
     
    matessim, Nov 22, 2010 IP