Jump to content

File extension when mixing PHP and HTML


phppup
Go to solution Solved by Barand,

Recommended Posts

Suppose a file contains a form with action=""

The HTML form self evaluates with PHP that is in the same file.

Perhaps the HTML includes PHP tags for error messages to be displayed (which I've seen in HTML files).

Does it matter whether the file itself is stored as a PHP file versus an HTML file?

Edited by phppup
Link to comment
Share on other sites

  • Solution
20 minutes ago, phppup said:

Does it matter whether the file itself is stored as a PHP file versus an HTML file?

Yes.

PHP code in an .html file will not be processed.

However, a .php file does not need to contain any PHP code; it can just contain HTML and will function as an .html file.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.