I'm having trouble getting my head around a concept on a site I'm trying to develop (I'm relatively new to PHP so it's taking me a while).
Basically, I have some html content within a PHP Variable that I'd like to output in a lightbox when clicking a link.
Currently, this works as follows -
echo '<a class="fancybox" id="inline" href="#data' . $limit . '">Read more</a>' ;
echo '<div style="display:none"><div id="data' . $limit . '"><h2 class="innertitle">' . $item['linktitle'] . '</h2>' . $item['descriptionfull'] . '</div></div>';
So what's happening here is that the variable is loading into a div on the page, which is hidden from the end user, clicking the link then loads this data into a lightbox using Fancybox. This works great but as the number of articles on the site increases (and their descriptionfull html) the page itself is getting very large and taking a long time to load.
So what I'd want to achieve if possible is to get the 'read more' link to point to another php file on the site that when loaded will bring in php variable dynamically. This saves the descriptionfull variables from getting loaded on the main page and should therefore only be loaded when the relevant readmore link is clicked.
Is this possible? Cheers.