Generating XML through PHP????
Posted: Mon Jan 23, 2006 10:55 am
feyd | Please use
This script pulls information from an HTML form and asp creates an xml document. My problem is that:-
1. My server doesnt accept 'asp'
2. My Database is MySQL
3. I'm rubbish at asp!
So the solution would be a PHP version of this script, or a method to create an XML document through PHP.
I hope/wish it is as easy as the asp version, but have heard rumours that i need to use somthing scary called XSLT?!
Any help will be much apreciated
Thanks,
Ash

feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hey everyone,
I'll describe the problem first of all.
Problem
I need to create an XML document containing variables taken from a MySql database passed through PHP 4.
I have the exact script in 'asp', shown below: -Code: Select all
<%@LANGUAGE="JavaScript"%>
<%Response.ContentType="application/xml";%>
<?xml version="1.0"?>
<record>
<name><firstname><%=Response.Write("firstname")%></firstname> <lastname><%=Request.Form.item("lastname")%></lastname></name>
<address><line1><%=Request.Form.item("address1")%></line1>
<line2><%=Request.Form.item("address2")%></line2>
<city><%=Request.Form.item("city")%></city>
<state><%=Request.Form.item("state")%></state>
<postalcode><%=Request.Form.item("postalcode")%></postalcode>
<country><%=Request.Form.item("country")%></country>
</address>
</record>1. My server doesnt accept 'asp'
2. My Database is MySQL
3. I'm rubbish at asp!
So the solution would be a PHP version of this script, or a method to create an XML document through PHP.
I hope/wish it is as easy as the asp version, but have heard rumours that i need to use somthing scary called XSLT?!
Any help will be much apreciated
Thanks,
Ash
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]