incidently this was eventually solved by upgrading to php5 and adding CURL support:
$post_string .= 'd=';
include('prefs.php');
$req = $_GET[file];
$data = file("{$baseUrl}/{$xmlDir}/$req.txt");
$passed_vars = array_keys($HTTP_GET_VARS);
for ($i=1; $i < count($data); $i++) {
$match = preg_replace("/\<([a-zA-z]+[a-zA-Z_-]*)\>(.*)<\/([a-zA-z]+[a-zA-Z_-]*)\>/","$1",$data[$i]);
for($n=0; $n < count($passed_vars); $n++) {
$retrv = $passed_vars[$n];
if (strstr("$match","$retrv")) {
$set = $_GET[$passed_vars[$n]];
$data[$i] = preg_replace("/\<([a-zA-z]+[a-zA-Z_-]*)\>(.*)<\/([a-zA-z]+[a-zA-Z_-]*)\>/","<$1>$set</$3>",$data[$i]);
} else {
}
}
$post_string .= $data[$i];
}
$url = "{baseUrl}/{$xmlDir}/response.xml";
$header .= "Content-type: text/xml";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, $header);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
$rdata = curl_exec($ch);
if (curl_errno($ch)) {
print curl_errno($ch);
print curl_error($ch);
} else {
curl_close($ch);
}
$xml = simplexml_load_string($mydata);
the only required argument is $_GET[file], which opens a txt version of the xml to send. the regular expressions process the xml, and whenever a GET key matches one of the tags, it inserts the value between the named tag, submits the data to response.xml via CURL, then loads it all into a simplexml object.
no clue when this would actually be helpful to anyone other than what i'm using it for, but hey, who knows :]