I need to make a html page, the normal, meta tags, header/footer, and between the body area, i need to drop a php page. In other words, i want a php page opening up in a html page. Is there a code, html or php so i can make another page appear in the html page without iframes?
To parse the php code in .html extenction , just add the following line of code in .htaccess file . AddType application/x-httpd-php .html .htm
Probably no other way than iframe. But you can add a php page inside another php page and later, you can call the main php page as a html page with the help of modrewrite.
Why not just use SSI... something like <html> <head> <title>Your Title</title> </head> <body> <!--#include file="php_file.php" --> </body> </html> Code (markup): that way you can keep the .html extension as the default or whatever. It also makes things a bit safer (in terms of passing variables through GET) If you can change the extensions, simply use PHP and put the HTML around the PHP tags
you can embed any html in a php file. just do, <?php //insert your php code here ?> <!-- type your normal html here --> Code (markup): hopes that helps
It's expected to read the topic and all the posts in a thread carefully before replying. The thread starter asked how a PHP file can be added inside an HTML file. You replied just the opposite. Please take care of these issues. I think, the best solution is already given above by tguillea.
its simple... just make a HTML page, design it, then save it as PHP. once u've saved it as PHP then u can easily code ur php script anywhere on the page within the <?php ?> tags.
there is another way of doing so Make a separate PHP file then include the file in HTML file. Syntax is <html> <body> <?php include("abc.php");> </body> </html>
I don't understand, why folks are not focusing on the title. The question was just opposite. We know, how to add a .html or .php page inside a .php page. But the thread starter wants to know (infact me too), how to add a .php file inside a .html file. If the file extension is .html and we write php codes there, the code will not be ececuted and will be shown as plain text. Though, a .html page can be used a .php page only using modrewrite. But any working idea of the exactly asked question is highly expected.
No offcourse not. You can execute php codes written inside any file. I mean, it really doesn't matter what extension the file is saved with. But, you must have apache server and some knowledge on apache mod rewrite.