Jump to content

PHP page, with HTML code


Norman

Recommended Posts

Hi. I've a question. Can I use a .php page extension using HTML code? I mean.. I need .php extension becouse, maybe, I will include also PHP code.. but right now, I will put there only HTML code. Do you think is this possible? If yes, can I start like a normal HTML page(

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">etc.

), or have I to do something more?

Link to comment
Share on other sites

Sure you can. But note that in this case, performance will be (very) slightly degraded, as PHP would try to parse those files even though they don't contain anything.If you decide to add some PHP at some point, just add it with <?php ?> as you'd do for any file.

Link to comment
Share on other sites

Also, feel free to experiment yourself. It seems like some people on here ask certain questions asking if something is possible when they could have just tried it and found out for themselves. Experimentation is how you learn and become a better programmer. Make a file, call it .php, and see what happens. The PHP parser only looks for PHP tags, if it doesn't find any PHP tags in the file then the PHP engine will never execute anything.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...