I have been working on this for a day (yes a day I only just started really learning PHP)
Here is the code:
Code:
The problem is that I have been having problems finding a way to replace the src="/image/somepic.png" to say src="http://somewebsite/images/somepic.png".
Any ideas?
Here is the code:
Code:
<html>
<body>
<form>
<input value="http://" name="url" type="text" />
<?php
echo file_get_contents($_GET['url']);
$basedomain = $_GET['url'];
$html = file_get_contents($_GET['url']);
echo "$html";
preg_replace('/src=\"(\/[^\"]+)\"/',"src= \"$basedomain\$1\",$html");
?>
</form>
</body>
</html>
The problem is that I have been having problems finding a way to replace the src="/image/somepic.png" to say src="http://somewebsite/images/somepic.png".
Any ideas?