-2

for example my website is "myweb.com". how can i do opration like following.

include(http://myweb.com/file);

this is an internal URL.

for example i want to include

http://myweb.com/process.php?action=update

this is not a file

 "?action=update"

thus how can i do this operation?

  • Your question sounds an awful lot like this one : http://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file – Dany Caissy Jun 21 '13 at 17:02
  • @DanyCaissy Obviously he copy and pasted it. In the first version of the question there was also the paste of "12 votes 1 favorite". – Shoe Jun 21 '13 at 17:04

2 Answers2

0

To include pages with PHP, simply put the following code in a.html, where you would like the code to appear:

<?php
    include "b.html";
?>
IanPudney
  • 5,941
  • 1
  • 24
  • 39
0

You can't include an HTML document into another HTML document.

You can do that using PHP but the file that includes the other must be a PHP document. In your example a includes b therefore a is a.php while b can stay b.html.

Then inside a.php you can write:

<?php echo file_get_contents('b.html'); ?>

and the content of b.html will be included into a.php.

Shoe
  • 74,840
  • 36
  • 166
  • 272
  • You *can* include an HTML document inside a PHP document, but assuming the HTML document is valid, you'd get invalid code. For example, an HTML file would have its own HTML, head, and body tags, which shouldn't be included inside another HTML document's body. – Kat Jun 21 '13 at 17:04
  • @Mike, "You can include an HTML document inside a PHP document". Yes, I said you *can't* include an HTML document inside another HTML document. – Shoe Jun 21 '13 at 17:05
  • It is possible Jeffrey, you can do something like this : – Dany Caissy Jun 21 '13 at 17:09
  • @DanyCaissy, an `iframe` isn't exactly like including an HTML page. `iframe`s have different headers. – Shoe Jun 21 '13 at 20:40
  • I know, but it's not impossible to include HTML in another HTML document. Maybe you can just reword it better and use the world "shouldn't" instead of "can't". – Dany Caissy Jun 21 '13 at 20:42