PHP include with query

software development

#1

Hi all,

I’m trying to include some information on a PHP page with an include. However the include requires a query. Following the example in the DH wiki I set up an include like this:

<?php $action = "include"; $app = "event"; $if_event_sourcewrd = "battle-of-bands"; $sortby = "login_date"; $reverse = "yes"; $temp_table = "event_show"; include($_SERVER['DOCUMENT_ROOT']."/directory/cgi/search.cgi"); ?>

The result displays the code of search.cgi. It doesn’t seem to be appending the queries. Any advice on how to achieve an include such as:
/directory/cgi/search.cgi?action=include&app=event&if_event_sourcewrd=battle-of-bands&sortby=login_date&reverse=yes&temp_table=event_show

This is all a bit new to me, my past host allowed php includes. So, is this even possible on DH?


#2

I believe I’ve answered my own question. Using cURL. At first I didn’t think it would allow an include like that, but it’s working. Here’s the current code that I’m using:

<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://mysite.com/directory/cgi/search.cgi?action=include&app=event&if_event_sourcewrd=$friendly_url&sortby=login_date&reverse=yes&temp_table=event_show"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); ?>

Thanks for your patience!