Solved

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now