sorry, the problem is that I don't know how to write the eregi/preg function so I didn't think the other code was inportant.
Here you go.
<html>
<title>goto</title>
<head>
<?php
$url = "";
if (strlen($_GET['goto']) > 0)
$url = $_GET['goto'];
else if (strlen($_POST['goto']) > 0)
$url = $_POST['goto'];
if (strlen($url) > 0)
echo'<base href="'.$url.'">';
?>
</head>
<body>
<?php
if (strlen($url) > 0)
{
echo "<font align=\"center\">$url</font>";
$ch;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec ($ch);
curl_close ($ch);
eregi ("<body([a-zA-z0-9!@#\$%\^&\*()_+-=><\?\`~\f\r\t\n\v /]*)/body", $result, $return);
echo "<a href=\"http://www.lhmshangout.com/goto/goto.php\" align=\"CENTER\">New Search</a>";
echo "<HR>";
echo $result;
echo "<HR>";
}
else
{
echo '<form method="POST" action="http://www.lhmshangout.com/goto/goto.php">';
echo 'Type in the exact url address';
echo '<input name="goto" type="text" value="http://www.">';
echo '<input name="submit" type="submit" value="GO">';
echo '</form>';
}
?>
</body>
</html>
what im tring to do is take $result, find all the complete links, and replace them. as you can see at the top i am using eregi... and was wondering how to write something like that to do the objectives above.