Ver Mensaje Individual
  #11 (permalink)  
Antiguo 06/10/2004, 00:52
Avatar de Erikzamith
Erikzamith
 
Fecha de Ingreso: septiembre-2003
Ubicación: Suecia
Mensajes: 75
Antigüedad: 20 años, 7 meses
Puntos: 0
Información Este es mi formulario, con el php

Hola Calin

Este es mi formulario, tiene un PHP.

Copia tal cual, bueno y despues le haces los cambios que quieras.

Este es el PHP, lo guardas como aximail.php
Lo guardas como aximail.php
Código PHP:
<?
while(list($nombre_campo$valor_campo ) = each($HTTP_POST_VARS )) {
strtolower ($nombre_campo);


if(
is_array($valor_campo)){
$msg .= ucfirst($nombre_campo).": \n";

while (list (
$val) = each ($valor_campo)) {
$msg .= $val."\n";
}
$msg .= "\n";
}else{
if(
$nombre_campo != "submit" && $nombre_campo !="receptor" && $nombre_campo !="remitente" && $nombre_campo !="tema" && $nombre_campo !="redireccion"){
$msg .= ucfirst($nombre_campo).": ".$valor_campo."\n\n"; }
}

}

$msg .= "----------------------------------------------\n";
$msg .= "USER AGENT: ".$HTTP_USER_AGENT."\n";
$msg .= "IP: ".$REMOTE_ADDR."\n";

mail($receptor,$tema,$msg,"Wrom: MYXOEAIJJPHSC");

header("Location: $redireccion");

?>

Ahora creas tu formulario en un HTML comun.
[HTML]
<form name="Contacto" method="post" action="../aximail.php" onsubmit="return comprobar(this)">
<table width="312" border="0" cellspacing="0" cellpadding="0" height="69" align="center">
<tr>
<td valign="top">
<h5 align="center"><b><font color="#00FF00" face="Tahoma">Namn:</font></b>
<input name="Namn" type="text" id="Namn" size="30">
</h5>
<h5 align="center"><b><font color="#00FF00" face="Tahoma">E-post:</font></b>
<input name="epost" type="text" id="epost" size="35">
</h5>
</td>
</tr>
</table>
<h5 align="center"><b><font color="#00FF00" face="Tahoma">Meddelande:</font></b>
<textarea name="Meddelande" cols="40" rows="5"></textarea>
</h5>
<p align="center"><font size="2" face="Arial, Helvetica, sans-serif"><b>
<input type="hidden" name="receptor" value="[email protected] ">
<input type="hidden" name="remitente" value="[email protected] ">
</b></font>
<input type="submit" name="Submit" value="Skicka">
<input type="reset" name="Reset"value="Rensa">
<font size="2" face="Arial, Helvetica, sans-serif"><b>
<input type="hidden" name="tema" value="Mensaje desde la pagina web">
<input type="hidden" name="redireccion" value="http://www.teatermask.com/tack.htm">
// Escribes una pagina donde informas que haz enviado el mensaje, o de gracias por el mensaje
</b></font></p>
</form>
Código HTML:
<head>
<title>Kontakta oss</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script> 

//Pon en la variable obligatorios el name de todos los campos que deben rellenar 

obligatorio=["Namn","epost","Meddelande"]; 

//Pon en la veriable textoObligatorio el texto que quieres que aparezca en el alert 

textoObligatorio=["Nombre","E-mail","Mensaje"]; 

function comprobar(este){ 
for(a=0;a<obligatorio.length;a++){ 

if(este.elements[obligatorio[a]].value==""){ 

alert("Escrive tu  "+textoObligatorio[a]); 
este.elements[obligatorio[a]].focus(); 
return false; 


} 

} 

return true; 
} 

</script> 

</head>

<body bgcolor="#000000">
<table width="755" height="509" border="0">
  <tr> 
    <td colspan="2" align="center" valign="top"> <div align="center"> 
        <h2><font color="#FFFF00" face="Eras Bold ITC, Eras Demi ITC, Eras Light ITC">E-POST</font></h2>
        <p><font color="#FFFF00" face="Eras Bold ITC, Eras Demi ITC, Eras Light ITC">Skicka 
          meddelande till oss</font></p>
      </div>
      <form name="Contacto" method="post" action="../aximail.php" onsubmit="return comprobar(this)">
        <table width="312" border="0" cellspacing="0" cellpadding="0" height="69" align="center">
          <tr> 
            <td valign="top"> <h5 align="center"><b><font color="#00FF00" face="Tahoma">Namn:</font></b> 
                <input name="Namn" type="text" id="Namn" size="30">
              </h5>
              <h5 align="center"><b><font color="#00FF00" face="Tahoma">E-post:</font></b> 
                <input name="epost" type="text" id="epost" size="35">
              </h5></td>
          </tr>
        </table>
        <h5 align="center"><b><font color="#00FF00" face="Tahoma">Meddelande:</font></b> 
          <textarea name="Meddelande" cols="40" rows="5"></textarea>
        </h5>
        <p align="center"><font size="2" face="Arial, Helvetica, sans-serif"><b> 
          <input type="hidden" name="receptor" value="[email protected] ">
          <input type="hidden" name="remitente" value="[email protected] ">
          </b></font> 
          <input type="submit" name="Submit" value="Skicka">
          <input type="reset" name="Reset"value="Rensa">
          <font size="2" face="Arial, Helvetica, sans-serif"><b> 
          <input type="hidden" name="tema" value="Meddelande från hemsidan">
          <input type="hidden" name="redireccion" value="http://www.teatermask.com/tack.htm">
          </b></font></p>
      </form></td>
  </tr>
</table>
</body> 
Si hay cosas que estan en sueco, y que tal vez no entienda, me puedes escribir a [email protected]

Espero te sirva

Chao...........
__________________
La madre de la invención es la necesidad.