Welcome to WebmasterWorld Guest from 50.17.74.162

Forum Moderators: httpwebwitch

Message Too Old, No Replies

Xml form mail with Php to send

form mail with Xml need Php file to send

     

kamstudio

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



Hi,

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

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

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

<!-- input field out color -->
<inputOutColor>0x2c2c2c</inputOutColor>

<!-- input over color-->
<inputOverColor>0x986464</inputOverColor>

<!-- input border thickness-->
<inputBorderThick>1</inputBorderThick>

<!-- input border color -->
<inputBorderColor>0xffffff</inputBorderColor>

<!-- input css tag-->
<inputCSSTag>input</inputCSSTag>

<!-- input warning text color -->
<inputWarningTextColor>0x660000</inputWarningTextColor>

<!-- 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-->
<buttonSendLabel><![CDATA[<send>Envoyer</send>]]></buttonSendLabel>

<!-- input button reset label-->
<buttonResetLabel><![CDATA[<reset>Vider</reset>]]></buttonResetLabel>

<!-- buttons out color -->
<buttonsOutColor>0xb1b1b1</buttonsOutColor>

<!-- buttons over color -->
<buttonsOverColor>0x986464</buttonsOverColor>

<!-- the url path to the PHP file-->
<phpFileURL>php/contact.php</phpFileURL>
</settings>

<!-- 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" />
</form>


I need Php File to send it to my mail.

Thank you.

httpwebwitch

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

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



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.
[php.net...]

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.

Cheers
 

Featured Threads

Hot Threads This Week

Hot Threads This Month