Solved

Get external/non-local webpage source with PHP? - convert from ASP?

Posted on 2006-07-21
2
229 Views
Last Modified: 2013-12-16
this was a previous question I had:
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21927719.html

this was the answer:
http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_21926190.html#17155324

now, can this be done in PHP as well? in the same way, but with different functions?  in a different way?

i guess all i really need to know is if there is something similar to the ASP script creating an XMLHttp object which "actually retrieves the entire contents of the page".
i am just trying to intercept the HTML source contents.

thank you in advance.

-- Jason
0
Comment
Question by:propractice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 29

Accepted Solution

by:
TeRReF earned 400 total points
ID: 17157233
<?php

$url = 'http://stores.ebay.com/Decorative-Fabric-Outlet';
$s = file_get_contents($url);
$s = str_replace(array('<script', '</script>'), array('<!--<script', '</script>-->'), $s);
print($s);

?>
0
 
LVL 29

Expert Comment

by:TeRReF
ID: 17157241
You could use this page again:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
  <title>Untitled Page</title>
</head>
<body>
<iframe src="frameshow.php" style="width:80%;height:300px;"></iframe>
</body>
</html>

Name the above php script framshow.php and you're ready to go...
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question