Thanks, BobRay. Sorry if I wasn’t clear in my question, I’ll try to rephrase it:
One MODx page contains a snippet which extracts data from a database and outputs (something like) the following:
Date, Time.
Event Title.
Event Location.
* [Get iCalendar entry]
When the reader views that page, they can (if they want) select the "Get iCalendar entry" link, which is intended to call another web page (a snippet, or PHP code, at any rate: perhaps snippet is not the right term here, but that’s the way to use PHP functions in MODx, isn’t it?) which will generate the iCalendar data for that event.
The second snippet isn’t connected with the first snippet in any way, apart from one: the link address that the first snippet already generated (in the text output above) has to contain a parameter in the link, so that that value can be used by the second snippet (ie, a $_GET[’var’] parameter in PHP terms) so that the second snippet (when called via that link) knows which event it needs to look up in the database to create the iCalendar data for.
However, this question may now be moot for me as I’ve now discovered that I can in fact create a real PHP file within the web file system, and therefore have the first snippet just create an ordinary web link pointing to that PHP file (eg,
http://mysite.dom/makeical?event=eventid), bypassing snippets and MODx altogether as I won’t then actually need to use a MODx snippet for the second function in this case.
This is a little odd, as I could swear that when I tried this approach earlier, MODx was intercepting the web address and returning a 404 (I thought because it was trying to look for such a page within the MODx pagelist, and obviously being unable to find it).. However, if it now works, that’s good enough for me in this instance.