-1

(I use Wamp64) I have a simple PHP file, but when I change the .php extension to .html, the page doesn't shows up correctly. This is my PHP file:

<!DOCTYPE html>
<?php
require ('steamauth/steamauth.php');
?>
<html>
<head>
    <title>page</title>
</head>
<body>
<?php
if(!isset($_SESSION['steamid'])) {

    echo "welcome guest! please login<br><br>";
    loginbutton(); 

}  else {
    include ('steamauth/userInfo.php');


    echo "Welcome back " . $steamprofile['personaname'] . "</br>";
    echo "here is your avatar: </br>" . '<img src="'.$steamprofile['avatarfull'].'" title="" alt="" /><br>';

logoutbutton();
}    
?>  
</body>
</html>

And this is my page (with .html extension): html page

1 Answers1

1

What you try is not possible. PHP is interpreted by the processor, which runs the code and structures and output the processed code to your page.

So i think what you try is you have to Rewrite your URL from ".html" to ".php". So you have the html extension in your url but you send it to a php file. Without the php extension your interpreter will not work.

Other possibility is that you change your file extension for php and include the html extension but that is not really common.

URL rewriting with PHP

René Höhle
  • 26,716
  • 22
  • 73
  • 82