PHP gets commented out in HTML

后端 未结 6 907
名媛妹妹
名媛妹妹 2020-12-05 06:59

I created a simple HTML webpage that includes the following PHP code in the HTML code.


When I run

6条回答
  •  萌比男神i
    2020-12-05 07:41

    Reference

    Create a file named hello.php and put it in your web server's root directory (DOCUMENT_ROOT) with the following content:

    Example #1 Our first PHP script: hello.php

    
     
      PHP Test
     
     
     Hello World

    '; ?>

    Use your browser to access the file with your web server's URL, ending with the /hello.php file reference. When developing locally this URL will be something like http://localhost/hello.php or http://127.0.0.1/hello.php but this depends on the web server's configuration. If everything is configured correctly, this file will be parsed by PHP and the following output will be sent to your browser:

    
     
      PHP Test
     
     
     

    Hello World

提交回复
热议问题