View file ad.php
<?php $id = "1"; function show_ads($id) { $get = 'http://localhost/project/index.php?ac=ads&id='.$id; $advertisement = file_get_contents($get); print $advertisement; } ?> <?php // put this code anywhere of your site to print ads echo show_ads($id); ?>