0

In development, should we convert the .html or .htm file extension to .PHP? To implement the PHP session, and not to redirect if the session is destroyed?

I mean, in C# we use RedirectToPagePermanent to keep the user to only access the pages the system will be redirected.

How about PHP?

for example process.

  1. Login Page
  2. If the user exists:
  3. Create a cache or session.
  4. Redirect to Main Page.
  5. if not then notify the user, and stays on the login page.
  6. On Main Page, there is a logout button.
  7. User clicks.
  8. Session destroyed.
  9. Redirect to the Login page.
  10. if the user clicks the back button of chrome, the main page will not be shown or redirected because there is no session.

So, in PHP, should I convert all the .HTML or .Htm file to .PHP?

Levesque Xylia
  • 349
  • 3
  • 16

2 Answers2

0

@Html.Php("yourpagename.php")

Switi
  • 359
  • 3
  • 6
0

You must convert

.html, .htm to .php to run as PHP and use the PHP session,

Or you must tell your web-server to serve them as PHP

For example in Apache, Create a .htaccess file at the root of your website and add this line:

AddType application/x-httpd-php .html .htm

This will tell your web-server to treat html,htm files as PHP files.

mahen3d
  • 7,047
  • 13
  • 51
  • 103