Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 23rd, 2006, 05:23 AM
Authorized User
 
Join Date: Jan 2004
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Ashleek007
Default generating XML through PHP

Hey everyone,

I'll describe the problem first of all.

[u]Problem</u>
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: -

<%@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>

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?!

Please help me phper's!
Thanks,
Ash

My new web design domain
www.askmultimedia.co.uk
__________________
My new web design domain
www.askmultimedia.co.uk
 
Old January 27th, 2006, 08:16 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://www.quepublishing.com/article...p?p=27800&rl=1





Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating XML m_rajib Crystal Reports 0 May 4th, 2006 07:51 AM
Generating documentation from the XML brko C# 2005 0 January 23rd, 2006 06:24 AM
Help generating text from xml billclay XSLT 1 April 21st, 2005 04:18 AM
Generating XML tags on the fly francislang XSLT 3 September 6th, 2004 05:21 AM
Generating aspx pages with xml and xslt glaseur XSLT 4 December 3rd, 2003 05:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.