Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Xml form mail with Php to send

form mail with Xml need Php file to send

2:29 pm on Jan 10, 2012 (gmt 0)

New User

5+ Year Member

joined:Jan 10, 2012
posts: 1
votes: 0


i have a Xml file :
<!-- input small width. Small width applies to the following types: name, email and phone -->

<!-- input small height. Small height applies to the following types: name, email and phone -->

<!-- input large height. Large height applies only to the message box -->

<!-- input field out color -->

<!-- input over color-->

<!-- input border thickness-->

<!-- input border color -->

<!-- input css tag-->

<!-- input warning text color -->

<!-- input warning message -->
<warningMessage><![CDATA[<warning>PLEASE FILL ALL REQUIRED( * ) FORMS!</warning>]]></warningMessage>

<!-- input sent message-->
<sentMessage><![CDATA[<delivered>Votre message a été envoyer, Merci !</delivered>]]></sentMessage>

<!-- input sent message-->
<serverErrorMessage><![CDATA[<warning>SERVER PROBLEM... PLEASE TRY AGAIN LATER! THANK YOU!</warning>]]></serverErrorMessage>

<!-- input button reset label-->

<!-- input button reset label-->

<!-- buttons out color -->

<!-- buttons over color -->

<!-- the url path to the PHP file-->

<!-- input fields -->
<input size="small" type="name" label="Nom" required="true" />
<input size="small" type="email" label="Email" required="true" />
<input size="small" type="phone" label="Tel" required="true" />
<input size="large" type="message" label="Message" required="true" />

I need Php File to send it to my mail.

Thank you.
4:37 pm on Jan 10, 2012 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
votes: 0

Hi kamstudio, welcome to WebmasterWorld!

It looks to me like everything in the <settings> node are merely formatting options for the HTML form.

So, step one will be to parse the XML and render it into an HTML page. You can do that with an XSLT stylesheet, or you can write a PHP script that does it using some of PHP's built-in XML parsing tools.

sending mail via PHP is easily accomplished with the mail() command.

So what you'll do is set the "action" attribute of the <form> do it posts to a PHP script. Then in that PHP script, get the data from the $_POST array, format it the way you like, then use mail() to send it.

There are lots of tutorials explaining this on the www, and many in the PHP forum who can help if you get stuck.