Re: Can PHP Build XML Pages?
| From: | Jeff Harris | Date: | Mon, 14 Jul 2003 17:03:00 +0000 |
| Subject: | Re: Can PHP Build XML Pages? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155123@lists.php.net to get a copy of this message | ||
On Jul 14, 2003, "Jeffrey Fitzgerald" claimed that:
|
| Looking for direction PHP and XML. I have a need to build a simple
|XML doc from a PHP set of form vars. Any tips or examples are greatly
|appreciated.
|
You mean something like
<?php
header("Content-Type: text/xml");
print ("<?xml version=\"1.0\" ?>\n");
print ("<shows>\n");
print (" <listing id=\"{$_POST['formdate']}\">\n");
print (" <venue>{$_POST['venuename']}>\n </venue>");
print (" </listing>\n");
print ("</shows>\n");
?>
Lay out your xml document first, then plug in the form variables. Make
sure you use that header() command, too.
Jeff Harris
-- Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc |
gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.