Thanks for the help. Luckily the script works as is, and I'm just trying to better my understanding of PHP instead of scabbling to make this work :-)
First, I'd like to get my head around why I can't use echo() or print(). Let me give this more context and hope this makes sense:
The variable $data is a string where the contents are mostly HTML but with some inline PHP code, as I said above. The contents of $data looks generally like this:
...</div>
<div class="ShowNotes"> (<?php CreatePopUpPhotoLink("/shows/flyers/20050218Metroposter.jpg", "poster", ""); ?>, <?php CreatePopUpPhotoLink("/shows/flyers/20050218Metroflyer.jpg", "flyer", ""); ?> )
</div>...
So when I say that echo() and print() "strip out" the php, it means that when I pass them the variable $data they will output:
...</div>
<div class="ShowNotes"> ( , )
</div>...
Or at least that's how it renders under a browser.
Then, with regard to eval(), I know that it just parses and evaluates a string. Where my confusion comes in is that when I say eval('?'.'>'.$data) I'm assuming that it's trying to evaluate essentially
"?>...</div>
<div class="ShowNotes"> (<?php CreatePopUpPhotoLink("/shows/flyers/20050218Metroposter.jpg", "poster", ""); ?>, <?php CreatePopUpPhotoLink("/shows/flyers/20050218Metroflyer.jpg", "flyer", ""); ?>
)
</div>..."
But somehow this gets passed to the browser just as if there had been an echo() or print() called. I would have thought I'd have to do something like eval('echo('.'?'.'>'.$data.')') in order to get this to output.
I'm obviously just confused, and I have a feeling it mostly has to do with single versus double quoting, but I'd love to understand this better.
Thanks so much