iframe to a specific div id on a landing page

0
335

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

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here