Solved

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

Posted on 2006-07-21
2
228 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn how to dynamically set the form action using jQuery.

696 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