Take HTML affiliate link from I-frame and display in PHP Include

Hi All,

I have a website which uses an iframe from an affiliate company to display their products.

The only issue is the number of items often changes in the iframe and so i either have loads of whitespace when there isn not alot in there, or i get scrollbars when i keep it fixed sized.

I have been told that i can use the link from the affiliate iframe to create a simple PHP include which would then dynamically size as expect.

I've attached the relevent code.

Many thanks,


<iframe src="http://www.mobiles4everyone.com/iframedisplay.asp?&search=ku990&search=u990&man=lg&showdeals=25&col=046fad&size=compact&ref=ku990.co.uk" style="width: 620px;  height: 500px;" scrolling="Yes" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0">
</iframe>

Open in new window

dazkeirleAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
nizsmoConnect With a Mentor DeveloperCommented:
hoep this helps:
http://www.weberdev.com/get_example.php3?ExampleID=4606

Gives you an insight on how to go about it.
0
 
nizsmoDeveloperCommented:
how about using javascript?

below is an example:
In the head of your document enter the following JavaScript code:
 
<script language="JavaScript">
<!--
function calcHeight()
{
  //find the height of the internal page
  var the_height=
    document.getElementById('the_iframe').contentWindow.
      document.body.scrollHeight;
 
  //change the height of the iframe
  document.getElementById('the_iframe').height=
      the_height;
}
//-->
</script>
 
////and in the body create the iframe tag:
 
<iframe width="700" id="the_iframe" 
	onLoad="calcHeight();" 
	src="testing_page.shtml" 
	scrolling="NO" 
	frameborder="1" 
	height="1">
An iframe capable browser is 
required to view this web site.
</iframe>

Open in new window

0
 
dazkeirleAuthor Commented:
on some pages i've got multiple iframes, each from the same place but with different values in the url string, how will this fair for each of them?
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
dazkeirleAuthor Commented:
This also didn't seem to work. check out http://www.ku990.co.uk/test.html I just get a collapsed box.
0
 
tonsofpcsCommented:
Why not use php include on the target rather than embedding it in an iframe, then you don't have to worry about its height.  
0
 
dazkeirleAuthor Commented:
I dont want the iframe, i just want the content of it, included within my website. I don't have access to the source, only this iframe which displays the results.

I just want the results displayed in atable without the frame.

What is the code for this, i have provided all i have.
0
 
nizsmoDeveloperCommented:
hmm sounds like you need to do it in a serverside language, php using curl is that an option?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.