Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-07-21
2
Medium Priority
?
231 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 1600 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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to implement server side field validation and display customized error messages to the client.
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

618 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