how to include external php file in to html page?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
How can we increase the execution time of a PHP script?
12 Answers CyberBeoz, Photon, XTX,
how to retrieve from database..... this format (PRMRMDU402). firstname= prabhu, lastname=kumar, city=madurai, pincode=624402.... i want first name first two letters and last name last two letters ... city first two letters ... pin code last three letters....
Why json is used in php?
What backslash character will match whitespace?
How can you propagate a session id?
What are default session time and path?
What is indexing how many types?
3 Answers DLF, Infosys, Net Solution, Vcare,
How to communicate with sockets in php?
How to track no of user logged in?
How can I check if a value is already in an array?
3 Answers Rushmore Consultancy,
What are the rules for naming a php variable?
How do you compare strings in java?