Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-10-2009
Member
 
Join Date: Sep 2009
Posts: 177
Include a html file by removing head / body

I would like to include a *.html, more precisely, only content (between <body> and </body>) while the beginning of the file, delete, has a fixed size (of <head> to <body>). However the content changes significantly.

I have heard of "parser", so I did a search and is more or less your fgets, but I do not see how to do what I want to do.

Can you help me how to include a HTML file by removing head / body?
Reply With Quote
  #2  
Old 09-10-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Include a html file by removing head / body

I will assume that you want to include menu.php in your file index.php

file menu.php
HTML Code:
<ul> 
<li> menu 1 </li> 
<li> menu 2 </li> 
</ul>
Then your file index.php
HTML Code:
<html> 
<head> </head> 
<body> 
<h1> up your text </h1> 
<? 
include ( 'menu.php'); 
?> 
</body> 
</html>
Reply With Quote
  #3  
Old 09-10-2009
Member
 
Join Date: Sep 2009
Posts: 177
Re: Include a html file by removing head / body

But the include file is created automatically by the software, it must be taken as such if I could remove the tags that do not interested me with notepad and include the file with an include, I would not ask so many questions do not worry. I never said I wanted to use at any price and only include.
Reply With Quote
  #4  
Old 09-10-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Include a html file by removing head / body

And what is stopping you from doing everything you need with the notepad? More seriously, here is what you need to follow:

- Get the position of the <body>
- Get the position of the </body>
- Get the contents of your file between the 2 position
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Include a html file by removing head / body"
Thread Thread Starter Forum Replies Last Post
How to include .SWF files to the html webpage LynDa55 Technology & Internet 3 15-01-2011 07:02 PM
How do I include one file inside another in HTML? Ekavali Software Development 4 19-08-2010 01:38 PM
How to include the video file in Html Owen Fernandes Software Development 5 29-12-2009 11:40 AM
How to include comments in HTML rooki Software Development 5 25-12-2009 01:06 PM
How to include Header & footer within HTML? seema_thk Software Development 3 09-12-2009 09:24 AM


All times are GMT +5.5. The time now is 05:52 AM.