iframe to a specific div id on a landing page

Below is the code to iframe an offer page but cut out all the stuff you don’t need. This is useful if you just want to iframe the form while using your own images etc. This is setup so you just enter the url and div id you want to jump to at the top of the php page. The height and width of the iframe can be adjusted further down. Positioning can be achieved with CSS if need be. It’s pretty simple when you know how but it took me a while to figure out how to do this, I was trying javascript onload commands and hiding buttons etc. Keep it simple stupid! Tested in Chrome, IE and Firefox

$out = 'http://trk.cpaoffer.com/?a_ref=jimam';
$divid = 'user-form';
<iframe src="<?php echo $out.'#'.$divid; ?>" name="target-iframe" height="200px" width="500px"></iframe>

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *