Forum Moderators: coopster
I'm trying to create a dynamic frameset that always loads a static page but can load a url of my choice?
The URL would look something like this:
http://www.example.com/frame.php?url=http://www.google.com
The top frame would *always* load "mypage.html", but the bottom frame would dynamically load the url specified in the ?url= variable (in the example above it would load google.com as the main frame)
I found this script in a different forum but I get errors when I run it:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<frameset cols="80,*" frameborder="no" border="0" framespacing="0">
<frame src="http://www.example.com/mypage.html" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />
<frame src="<?php echo $_GET['url']; ?>" name="mainFrame" id="mainFrame" title="mainFrame" />
</frameset>
<noframes><body>
</body></noframes>
</html>
Does anybody know how I can get this to work?
Thanks!
[edited by: dreamcatcher at 7:51 am (utc) on May 27, 2009]
[edit reason] use example.com. Thanks. [/edit]
the script above is up and running. A permission on the server had to be changed for it to work.
Unfortunately I had to figure out that the link for the main page will not work if it comes from a database with strings, but it does work if I replace it (the main frame link) with a tinyurl.
The link for the main page is always the same and only a four digit number changes.
Is it possible to add most of the main link into the actual code and pull only the variable (in this case 1234 or any other four digit number) by entering it to the frame link.
So instead of:
http://www.example.com/frame.php?url=http://xyz.com/index.cfm?fuseaction=showdetails&ln=1234&query=fuseaction=results&newsearch=yes
I only would have to use something like:
http://www.example.com/frame.php?x=1234
to get to the same frame page?
Thanks for all your help in advance
[edited by: dreamcatcher at 7:51 am (utc) on May 27, 2009]
[edit reason] use example.com. Thanks. [/edit]
It may be something as simple as urlencoding the links you are using from the database: urlencode [php.net].