execute php in html without using post?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • marslee@hotmail.com

    #1

    execute php in html without using post?

    I want to display some of the text from php in HTML without using POST
    method.
    For example: Hello.php
    <?php
    echo "hello ";
    ?>

    If i want to display Hello in main.html, How can i do that?

  • BKDotCom

    #2
    Re: execute php in html without using post?

    ¿without using POST method?
    post is used to submit form data.
    generally .html files are not parsed by the web server.

    any reason you can't rename main.html to main.php?
    and then you could either do your echoing directly in main.php or
    <?php
    include 'Hello.php';
    ?>

    Comment

    • Bowen

      #3
      Re: execute php in html without using post?

      Since HTML pages are completely static you are going to struggle to
      write a variable from one .php page onto a .html page. You could use
      sessions to pass along the text, or the GET method.

      Comment

      Working...