Jump to content

Load Multiple Iframes From A "?url=" String..?


cyfer65

Recommended Posts

http://www.url.com/search/result?url=http://www.google.comyou see how this link above will display the website http://www.google.com in one big iframe from the "?URL=" string parameter..how could i code a lil page that will do the same thing.. but instead of just 1 iframe of the URL specified in the "?URL=" string parameter, I would like to make 2 or 3 iframes all displaying the same URL..How could I do this..??
Link to comment
Share on other sites

Hi!I am not quite sure why you would want to do this but I think if you added height="30%" to the iframes that should work, then you could have three of them and 10% of a page for a header. So like this, but three times.

<iframe src ="yourlinklocation.com" width="100%" height="30%"><p>Write something here for people who cant see iframes</p></iframe>

That should work. I can understand 3 iframes to different pages, but why just link to the same one page? Im curious.

Link to comment
Share on other sites

if "iframe.php" is a page, you could get the value of "url" which in your case seems to be google in that example with "GET"then the iframe source would be like.... the URL "http://google.com"with'>http://www.MyWebsite.com/Iframe.php?url=http://google.com"with

src="<?php echo $_GET['url']; ?>"

would turn intosrc="http://google.com"

Link to comment
Share on other sites

If I understand what you are saying this is a VERY basic idea of what you need...

<?phpif(isset($_GET['url'])){	echo "<iframe src='".$_GET['url']."' width='500px' height='500px' ></iframe>";	echo "<iframe src='".$_GET['url']."' width='500px' height='500px' ></iframe>";}?>

This should work, but it is not very secure, just an extremely simple answer.

Link to comment
Share on other sites

What is the purpose of this? I'm thinking there's most likely a better way. If you can explain why you need three iframes displaying a page I probably can find an alternative method that works much better.

Link to comment
Share on other sites

im having some issues with the $_GET['url'] function on some URL strings that already contain the characters "%&=" in them..The URL seems to get truncated and some parts of the URL get cut out..Is there any way to make sure it retains all the characters in the URL string variable after "?url="And is it also true that the Get method is not suitable for large variable values; because the value cannot exceed 100 characters...??

Link to comment
Share on other sites

$_GET has a limit to its length (I'm not sure if it's 100), $_POST doesn't have any limitations to the amount of data you can send.

Link to comment
Share on other sites

so would javascript be better a better way to go for this then since its not limited to a certain amount of characters..??how could i do this same thing in JS by getting the URL string & making 2 iframes out of them..??

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...