Código PHP:
<form action="enviar_correo.php" method="post">
<p align="right">
Nombre: <input name="name" type="text" id="name" size="40"/>
</p>
<p align="right">E-mail: <input name="email" type="text" id="email" size="40"/>
</p>
<p align="right">Telefono: <input name="telefono" type="text" id="telefono" size="40"/>
</p>
<div class="divider2"></div>
<div align="left" class="contentarea">Diseño web
</div>
<label for="diseñoweb"></label>
<div align="left">
<h5>
<select name="diseñoweb" id="diseñoweb">
<option value="Si">Si</option>
<option value="no">No</option>
</select>
(El diseñador luego se contacta)
</h5>
<p><div class="divider1"></div>
</div>
<h5 align="left">Elegir juego a preferencia:</h5>
<p>
<label>
<input type="radio" name="Gameserver" value="cs" id="Gameserver_0" />
Counter-Strike 1.6</label>
<br />
<label>
<input type="radio" name="Gameserver" value="mu" id="Gameserver_1" />
MuOnline</label>
<br />
<label>
<input type="radio" name="Gameserver" value="uo" id="Gameserver_2" />
UltimaOnline</label>
<br />
<label>
<input type="radio" name="Gameserver" value="tibi" id="Gameserver_3" />
Tibia</label>
<br />
<label>
<input type="radio" name="Gameserver" value="linedos" id="Gameserver_4" />
Lineage II</label>
<br />
<label>
<input type="radio" name="Gameserver" value="hb" id="Gameserver_5" />
HelBreath</label>
<br />
<label>
<input type="radio" name="Gameserver" value="gunz" id="Gameserver_6" />
Gunz</label>
<br />
<label>
<input type="radio" name="Gameserver" value="warcraft" id="Gameserver_7" />
Wolrd Of Warcraft</label>
<br />
<label>
<input type="radio" name="Gameserver" value="ragnarok" id="Gameserver_8" />
Ragnarok</label>
</p>
<h5 align="left">Elegir capacidad:</h5>
<p>
<label for="fps"></label>
<select name="fps" size="1" id="fps">
<option value="12">12</option>
<option value="14">14</option>
<option value="16">16</option>
<option value="18">18</option>
<option value="20">20</option>
</select>
<strong>Fps</strong> <strong>Slots</strong></p>
<p>
<label for="rpg"></label>
<label for="rpg"></label>
<select name="rpg" id="rpg">
<option value="Nada">Ninguno</option>
<option value="muv1">MuOnline Vps1</option>
<option value="muv2">MuOnline Vps2</option>
<option value="muv3">MuOnline Vps3</option>
<option value="uov1">Ultima Online Vps1</option>
<option value="uov2">Ultima Online Vps2</option>
<option value="uov3">Ultima Online Vps3</option>
<option value="tibiv1">Tibia Vps1</option>
<option value="tibiv2">Tibia Vps2</option>
<option value="tibiv3">Tibia Vps3</option>
<option value="linedosv1">Lineage II Vps1</option>
<option value="linedosv2">Lineage II Vps2</option>
<option value="linedosv3">Lineage II Vps3</option>
<option value="hbv1">HelBreath Vps1</option>
<option value="hbv2">HelBreath Vps2</option>
<option value="hbv3">HelBreath Vps3</option>
<option value="gunzv1">Gunz Vps1</option>
<option value="gunzv2">Gunz Vps2</option>
<option value="gunzv3">Gunz Vps3</option>
<option value="wowv1">Wow Vps1</option>
<option value="wowv2">Wow Vps2</option>
<option value="wowv3">Wow Vps3</option>
<option value="ragnav1">Ragnarok Vps1</option>
<option value="ragnav2">Ragnarok Vps2</option>
<option value="ragnav3">Ragnarok Vps3</option>
</select>
<strong> Rpg</strong> <strong>Vps</strong></p>
<h5 align="left">Escribinos tu comentario aparte </h5>
<p align="center">
<textarea name="query" cols="30" rows="10" id="query"></textarea>
</p>
<p align="right">
<input name="submit" type="submit" class="boxx1" value="Enviar mensaje" />
<input name="clear" type="reset" class="boxx1" id="clear" value="Borrar"/>
</p>
Código PHP:
$mail='[email protected]';
$mailheader .= "[email protected]";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$returnpage = 'index.php'; // insert the name of the page/location you want the user to be returned to
$sitename = 'GameServer - Pedido'; // insert the site name here, it will appear in the subject of your email
/* Do not edit below this line unless you know what you're doing */
$name = $_POST['name'];
$email = $_POST['email'];
$telefono = $_POST['telefono'];
$enquiry = stripslashes($_POST['query']);
$fps = $_POST['fps'];
$fps = $_POST['rpg'];
if (!$name) {
print("<strong>Error:</strong> Escriba su nombre.<br/><br/><a href='java script:history.go(-1)'>Regresar</a>");
exit;
}
if (!$email) {
print("<strong>Error:</strong> Porfavor escriba su e-mail.<br/><br/><a href='java script:history.go(-1)'>Regresar</a>");
exit;
}
if (!$enquiry) {
print("<strong>Error:</strong> Porfavor escriba un mensaje.<br/><br/><a href='java script:history.go(-1)'>Regresar</a>");
exit;
}
if (!eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email)){
print("<strong>Error:</strong> este email no es valido, favor escribir su e-mail el correcto.<br/><br/><a href='java script:history.go(-1)'>Regresar</a>");
exit;
}
if (!$telefono) {
print("<strong>Error:</strong> Porfavor escriba su telefono.<br/><br/><a href='java script:history.go(-1)'>Regresar</a>");
exit;
}
$message = "\n$name te ha enviado el siguiente mensaje:\n\n$enquiry\n\n Sus datos son:\n\nNombre: $name\nCorreo: $email\nTeléfono: $telefono\n\n";
mail($mailto, "$sitename Contact Form Enquiry from $name", $message, "From: $email");
header("Location: " . $returnpage);
?>