Ok, what I got with your pretty code:
When using this:
PHP Code:
<?php
if (isset($_POST['url'])) {
$domain = $_POST['url'];
$correct_domain = "http://www.";
$chars_allowed = strlen($correct_domain);
if (substr($domain, 0, $chars_allowed)== $correct_domain) {
?>
<!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" dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="refresh" content="0;url=<?php echo $domain;?>" />
</head>
<body>
<?php
$requested_page = file_get_contents($domain);
$requested_page = str_replace("<head>", "<head>\n<script type=\"text/javascript\" src=\"splashpage.js\"></script>\n", $requested_page);
//$requested_page = str_replace("<head>", "<head>\n<base href=\"$domain\" />\n<script type=\"text/javascript\" src=\"splashpage.js\"></script>\n", $requested_page);
echo $requested_page;
} else {
//Error, you can handle this however you want
?>
<!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" dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body>
//<span style="color:#ff0000;">Please Enter a Valid Domain starting with <?php echo $correct_domain; ?>.</span>
<?php
}
}
?>
... I get the splashpage.js on top, except the images on the page under, are not shown.
If I take out this part:
PHP Code:
<!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" dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="refresh" content="0;url=<?php echo $domain;?>" />
</head>
... the page called per html shows correctly, but splashpage doesnt show on top at all.
I am desperated:-)
Bookmarks