Page 1 of 1

How do I pass GET and POST paramaters to load method?

Posted: Thu Sep 07, 2006 2:29 am
by nadavvin
hello

J have a php page which transfer xml with xslt.
The xml page is a php page which get parameters in GET and POST.
How do I pass the GET and POST data of the first php to the xml php page?

Code: Select all

<?php
$xml = new DOMDocument;
$xml->load('http://localhost/blog/');

$xsl = new DOMDocument;
$xsl->load('Happy_Blog.xsl');
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
$result= $proc->transformToXML($xml);
echo str_replace('<textarea name="Description" cols="35" rows="20"/>','<textarea name="Description" cols="35" rows="20"></textarea>',$result);
?>

Posted: Thu Sep 07, 2006 2:48 am
by Mordred

Code: Select all

$xml->load('http://localhost/blog/?param1=value1&param2=value2');
But it feels funny, having to request a page for the generating of the xml, I'd suggest refactor with a regular function call

Code: Select all

$xml->load(GenerateXml($value1, $value2));

Posted: Thu Sep 07, 2006 2:58 am
by nadavvin
but I don't always pass the same parameters, and what if POST?