|
Author |
Message |
Iyonix
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Sun Nov 17, 2002 6:26 pm (22 years, 5 months ago) |
  |
Hi.
I am connecting to a server using fsockopen() and requesting a webpage. It gives me a header and then the page or image code etc:
Code: |
HTTP/1.1 200 OK
Date: Sun, 17 Nov 2002 18:20:06 GMT
Server: Apache/1.3.27 (Unix) mod_gzip/1.3.19.1a mod_watch/3.13 Chili!Soft-ASP/3.6.2 PHP/4.2.3
X-Powered-By: PHP/4.2.3
Connection: close
Content-Type: text/html
<html>
<body>
<h1>This is a test page.</h1>
</body>
</html>
|
What I want is just the html code or the image code (depending on what I am requesting) and not the header. I was wondering how I could do this? I have been playing around with explode, but it hasn't really worked.
Any Ideas?
Thx |
|
|
    |
 |
Daniel
Team Member


Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Nov 17, 2002 7:07 pm (22 years, 5 months ago) |
  |
What about this:
Code: | $html=explode('<html>', $name_of_variable);
$html='<html>
'.$html[1]; |
However, in this case, an include statement would do the job with less work... |
________________________________

Last edited by Daniel on Wed Nov 20, 2002 2:57 pm, edited 1 time in total |
|
    |
 |
eKstreme
Ex Team Member


Joined: 12 Jan 2002
Posts: 11
Location: UK
|
Posted:
Mon Nov 18, 2002 12:59 am (22 years, 5 months ago) |
  |
Just to add to Daniel's post, the header is always seperated from teh code with two new lines... Test for \n\n or \r\n\r\n. But I think in your case, Daniel's answer is better suited.... |
|
|
     |
 |
jayant
Team Member


Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India
|
Posted:
Wed Nov 20, 2002 11:42 am (22 years, 5 months ago) |
  |
|
       |
 |
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.110324 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |