how to include external php file in to html page?

Answers were Sorted based on User's Feedback



how to include external php file in to html page?..

Answer / kesavan

you can include by using <iframe> like below this

<iframe src="external.php"></iframe>


you can get the output of the external.php in this iframe.

Is This Answer Correct ?    38 Yes 16 No

how to include external php file in to html page?..

Answer / pravi

Only .php extension files can be added by the following
syntax.

include("filename.php");
require("filename.php");
include_once("filename.php");
require_once("filename.php");

The only difference between the include and require is the
error handling.
Include - just gives warning errors
Require - gives fatal errors

Is This Answer Correct ?    25 Yes 10 No

how to include external php file in to html page?..

Answer / edin

Hi Sott,

only possible way is to include your PHP file above or
belowe HTML tags like

<?php include("filename.php");?>
<?php require("filename.php");?>
<?php include_once("filename.php");?>
<?php require_once("filename.php");?>

Or with inline frame
<iframe src="external.php"></iframe>

Exanple frin Sudheer is also OK, but if you want to execute
some PHP code.

Is This Answer Correct ?    9 Yes 2 No

how to include external php file in to html page?..

Answer / aar kay

yeahh we can use iframe

Is This Answer Correct ?    7 Yes 6 No

how to include external php file in to html page?..

Answer / aar kay

We can include HTML files tooo

Is This Answer Correct ?    6 Yes 7 No

how to include external php file in to html page?..

Answer / scott

I tried both of the above methods on my application and
both had the same result. The browser wnated to download
and save the file instead of displaying it on the html
page. Any other ideas?

Is This Answer Correct ?    5 Yes 6 No

how to include external php file in to html page?..

Answer / sudheer

<form name="frm" method="POST" action="sample.php">
....
....
....
Here submit button
</form>
When click submit sample.php will execute

Is This Answer Correct ?    8 Yes 11 No

how to include external php file in to html page?..

Answer / cd

not possible if the file is something.html or something.htm
only possible if the entire html code is written in .php
extension file

Is This Answer Correct ?    14 Yes 23 No

Post New Answer

More PHP Interview Questions

Is python easier than php?

0 Answers  


how to track no of users logged in?

0 Answers  


what is interface in java.

4 Answers  


What is a simple php method to make a cross domain data request?

0 Answers  


Explain about looping in PHP?

0 Answers  






What are different types of Print Functions available in PHP?

0 Answers  


What is difference between php and wordpress?

0 Answers  


hi to all i am fresher in php and want to learn php and want a fresher job in php. how to total time i expend to learn php and what is freshers salary.

9 Answers  


1.What are the difference between echo , print , print_r ? else this 3 can we show output to a client in some other way?

16 Answers   Leeway Hertz,


Is it possible to get the screen resolution and like with php?

1 Answers  


Is it possible multiple inheritance in php?

0 Answers  


Can I write php code in html file?

0 Answers  


Categories