Hi,
i wonder if the following code can be converted to PHP.
I have the following html/javascript code:
::index.htm::
:: page1.htm ::
::framed.js::
This works fine except that you get a ugly URL like Is there a way to hide the URL string or to make it look like a random string?
I found this php code somewhere on the net. Is does something similair as the above:
::index.php::
:
arkhopper.php::
The problem with the code above is that i also load pages with an URL with parameters in my iframe. These would not work..
---
It's never too late to do the Right thing
i wonder if the following code can be converted to PHP.
I have the following html/javascript code:
::index.htm::
Code:
<html>
<head>
<title>Index</title>
</head>
<body>
<script language="javascript">
// writes in the iframe
contPage = (location.search.substring(1))? location.search.substring(1) : 'page1.htm';
contPage = unescape(contPage);
document.write('<center>');
document.write('<iframe src="'+contPage+'" name="content" height="300" width="400">');
document.write('</iframe>');
document.write('</center>');
</script>
</body>
</html>
:: page1.htm ::
Code:
<html>
<head>
<title>Page 1</title>
</head>
<body>
<script LANGUAGE = "JavaScript" src=framed.js></script>
<h1>Test page</h1>
</body>
</html>
::framed.js::
Code:
pageLoc = self.location;
pageAdd = top.location;
if (pageLoc == pageAdd) {
contentSrc = escape(pageLoc);
contPage = 'index.htm?' + contentSrc;
top.location.href = contPage;
}
This works fine except that you get a ugly URL like Is there a way to hide the URL string or to make it look like a random string?
I found this php code somewhere on the net. Is does something similair as the above:
::index.php::
Code:
<iframe src="<?php
echo ($_GET['page']?$_GET['page']:"indextext") . ".php";
?>"></iframe>
:
Code:
<script type="text/javascript">
if(top.location.href==self.location.href) {
top.location.href = "index.php?page=parkhopper";
}
</script>
The problem with the code above is that i also load pages with an URL with parameters in my iframe. These would not work..
---
It's never too late to do the Right thing