How to add php code to html site?

Discussion in 'Programming' started by beinghappy4ever, Jul 19, 2009.

  1. #1
    Hi dear friends,

    I have a small business firm in india and it is running well now. So am planning to add a Yahoo paypal shopping cart to the payments of the job registrations and dealerships.

    I could developt the code in php. But as I made this site in simple html and css will there be any problem adding this to the site?

    Or is there anything extra which i have to do for this..Please help me out...

    This is the site and its simple html only :http://www.newgenresoft.com

    Thanks in advance for the advices
     
    beinghappy4ever, Jul 19, 2009 IP
  2. indyonline

    indyonline Prominent Member

    Messages:
    4,626
    Likes Received:
    248
    Best Answers:
    2
    Trophy Points:
    335
    #2
    You can add PHP to it or build your new pages in PHP
     
    indyonline, Jul 19, 2009 IP
  3. putradi

    putradi Active Member

    Messages:
    363
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #3
    u can use <script language="PHP">ur PHP code</script>
     
    putradi, Jul 19, 2009 IP
  4. -Hammad-

    -Hammad- Peon

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    or you can just add the standart PHP opening and closing tags
    <?php
    code here...
    ?>
    PHP:
    and change your file's extension to .php so it can read and parse the php code.
     
    -Hammad-, Jul 21, 2009 IP
  5. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    No browser understands that, PHP is a SERVER sided scripting language.

    You have to use a .php extension on the file, otherwise the webserver will not run the script thru the PHP parser (or you have to modify the htaccess to associate .html extension with php, but you run the risk of a lot of breakage in the occurance of <? that wasn't intended as a php script)

    Simply put once the extension is .php, you can use <?php ... ?> to surround the php code. (some servers are configured for short tags, that is to say <? ... ?> is valid.
     
    kblessinggr, Jul 21, 2009 IP