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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nadavvin
Forum Commoner
Posts: 68
Joined: Wed Sep 06, 2006 6:05 am

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

Post 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);
?>
Last edited by nadavvin on Thu Sep 07, 2006 2:58 am, edited 1 time in total.
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Post 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));
nadavvin
Forum Commoner
Posts: 68
Joined: Wed Sep 06, 2006 6:05 am

Post by nadavvin »

but I don't always pass the same parameters, and what if POST?
Post Reply