What is the difference between php and html file extensions? -


i having .php file following code. while changing extension of file .html behaving in same way. can explain following:

  1. why file behaving in same manner both extensions?
  2. what difference between .php , .html file extensions?

.php file

<html>       <head>           <!-- html code -->      </head>       <body>           <?php echo "hello!" ?>      </body>  </html> 

the filetype way identify file, can't trust them.

depending on web server configuration, see different results.

.html use html no serverside code.

.php used serverside php code , html if required.

they can used anything, depends on setup.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -