I have a page named print_data.php. To view the data of this page the url should be like print.data?id=12
I have taken this in variable $url.
<?php $url = "print_data.php?id=".$row_rstest['id']; ?>
Then passed this $url in function popitup(). The important thing is to put the sign (‘) around $url variable. Otherwise the function didn’t work for link.
<?php echo "<a href=\"\" onClick=\"return popitup('$url') \">Click here to open a pop up window</a>"; ?>