Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-11-18
9
Medium Priority
?
437 Views
Last Modified: 2011-09-20
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

0
Comment
Question by:dazkeirle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
9 Comments
 
LVL 21

Expert Comment

by:nizsmo
ID: 20307132
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
 

Author Comment

by:dazkeirle
ID: 20307134
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
 

Author Comment

by:dazkeirle
ID: 20307143
This also didn't seem to work. check out http://www.ku990.co.uk/test.html I just get a collapsed box.
0
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 
LVL 8

Expert Comment

by:tonsofpcs
ID: 20309521
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
 

Author Comment

by:dazkeirle
ID: 20311643
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
 
LVL 21

Expert Comment

by:nizsmo
ID: 20314274
hmm sounds like you need to do it in a serverside language, php using curl is that an option?
0
 
LVL 21

Accepted Solution

by:
nizsmo earned 2000 total points
ID: 20314281
hoep this helps:
http://www.weberdev.com/get_example.php3?ExampleID=4606

Gives you an insight on how to go about it.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question