Buenos días,,,,he intentado vincular un formulario llamado contact.php a una página XML os dejo los códigos a ver si véis algo raro
--------
<?xml version="1.0" encoding="utf-8" ?>
<data>
<title_info><![CDATA[INFORMATION]]></title_info>
<title_form><![CDATA[E-mail Form]]></title_form>
<info><![CDATA[<font size="14">C/ Vigo<br/><br/>M: +34 677 153 030<br/><font color="#66cc66"><a href="mailto:[email protected]" target="_blank">[email protected]</a></font></font>]]></info>
<image url="images/contact/1.jpg"/>
<iconwidth>24</iconwidth>
<iconheight>24</iconheight>
<!-- icon src and link-->
<icon src="images/socails/facebook.png" link="#,_blank" />
<!-- php contact form -->
<form active="true">
<!-- text -->
<name text="Name"></name>
<email text="Email"></email>
<message text="Message"></message>
<!-- color -->
<border normal="0xffffff" focus="0xffffff"></border>
<background normal="0x000000" focus="0x000000"></background>
<text normal="0xffffff" focus="0xffffff"></text>
</form>
</data>
Y este es el formulario de contacto
<?php
$companyemail = "[email protected]";
$subject = "Has recibido un mensaje";
$idvar = isset($_REQUEST['idvar']) ? $_REQUEST['idvar'] : "";
if($idvar == "email") {
$name = isset($_REQUEST['name']) ? $_REQUEST['name'] : "";
if($name == ""){
$name = "No has introducido un nombre.";
}
$email = isset($_REQUEST['email']) ? $_REQUEST['email'] : "";
$message = isset($_REQUEST['message']) ? $_REQUEST['message'] : "";
if($email != "" && $message != ""){
$mailtext .= "Mensaje enviado:\n\n";
$mailtext .= "name: " . $name . "\n";
$mailtext .= "email: " . $email . "\n";
$mailtext .= "message:\n";
$mailtext .= "" . $message . "\n\n";
$head = "From: [email protected] <yourcompany> \n";
$head .= "Content-Type: text/plain; Charset=utf-8\n\n";
$head .= "Reply-To: " . $email . "\n\n";
if(mail($companyemail, $subject, $mailtext, $head)) {
print "&success=true";
}
}
}
?>