SA-MP Forums Archive
Me ayudan PHP?= - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Me ayudan PHP?= (/showthread.php?tid=194041)



Me ayudan PHP?= - benjas09 - 28.11.2010

BUeno ando armando un webhost y qiero armar un contratar qe llene un Formulario y se envie a X email.

Ya tengo el formulario terminado, pero el envio de mail se me puso dificil, me ayudan?

Код HTML:
<div id="page">
		<div id="content">
			<div class="post">
				<h2 align="center" class="Estilo4">Formulario de Contrataciуn  </h2>
				<div class="entry">
				  <div>
				    <div>
				      <p align="center"><a href="servicios.php" tppabs="servicios.php"></a><a href="servicios.php" tppabs="servicios.php"></a><a href="servicios.php" tppabs="servicios.php"></a><a href="servicios.php" tppabs="servicios.php"></a><a href="servicios.php" tppabs="servicios.php"></a><a href="servicios.php" tppabs="servicios.php"></a></p>
			          <table width="579" height="305" cellpadding="0">
                        <tr>
                          <td width="203"><div align="right">Servicio:</div></td>
                          <td width="257"><form id="form1" name="form1" method="post" action="">
                            <label>
                              <select name="select" size="1">
                                <option selected="selected"><? echo $plan1 ?></option>
								 <option selected="selected"><? echo $plan2 ?></option>
								 <option selected="selected"><? echo $plan3 ?></option>
                                  </select>
                            </label>
                            <span class="Estilo5">*</span>
                          </form>                          </td>
                        </tr>
                        <tr>
                          <td><div align="right">Apellido y Nombre:</div></td>
                          <td><form id="form2" name="form2" method="post" action="">
                            <label>
                              <input name="textfield" type="text" />
                            </label>
                          <span class="Estilo5">*</span>
                          </form>                          </td>
                        </tr>
                        <tr>
                          <td><div align="right">Email:</div></td>
                          <td><form id="form3" name="form3" method="post" action="">
                            <input name="textfield3" type="text" />
                            <span class="Estilo5">*
                            <label></label>
                            </span>
                          </form>                          </td>
                        </tr>
                      
                     
                     
                       
                        <tr>
                          <td><div align="right">Dominio:</div></td>
                          <td><form id="form8" name="form8" method="post" action="">
                            <label>
                              <input name="textfield7" type="text" />
                            </label>
                            
                            <span class="Estilo5">*</span>
                          </form>                          </td>
                        </tr>
                        <tr>
                          
                        </tr>
                        
                        <tr>
                          <td><div align="right">Forma de Pago: </div></td>
                          <td><form id="form11" name="form11" method="post" action="">
                            <label>
                              <select name="select2" size="1">
                                <option>Paypal</option>
                                      </select>
                            </label>
                            <span class="Estilo5">*</span>
                          </form>                          </td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td><form id="form12" name="form12" method="post" action="">
                            <label>
                              <input type="submit" name="Submit" value="Enviar" />
                            </label>
                            <label>
                            <input type="reset" name="Submit2" value="Borrar" />
                            </label>
                          </form>                          </td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                      </table>
Como hago qe envie el mail?


Respuesta: Me ayudan PHP?= - xenowort - 28.11.2010

usa la funcion mail();

PHP код:
bool mail string $to string $subject string $message [, string $additional_headers [, string $additional_parameters ]] ) 
(Sуlo en Windows) Cuando PHP habla directamente con un servidor SMTP, si se encuentra un punto al principio de la lнnea, se elimina. Para evitar esto, es necesario reemplazar estos casos con un doble punto.

PHP код:
<?php
$text 
str_replace("\n.""\n.."$text);
?>
Aca tienes un ejemplo:

PHP код:
<?php
// Varios destinatarios
$para  'aidan@example.com' ', '// atenciуn a la coma
$para .= 'wez@example.com';

// subject
$titulo 'Recordatorio de cumpleaсos para Agosto';

// message
$mensaje '
<html>
<head>
  <title>Recordatorio de cumpleaсos para Agosto</title>
</head>
<body>
  <p>ЎEstos son los cumpleaсos para Agosto!</p>
  <table>
    <tr>
      <th>Quien</th><th>Dнa</th><th>Mes</th><th>Aсo</th>
    </tr>
    <tr>
      <td>Joe</td><td>3</td><td>Agosto</td><td>1970</td>
    </tr>
    <tr>
      <td>Sally</td><td>17</td><td>Agosto</td><td>1973</td>
    </tr>
  </table>
</body>
</html>
'
;

// Para enviar un correo HTML mail, la cabecera Content-type debe fijarse
$cabeceras  'MIME-Version: 1.0' "\r\n";
$cabeceras .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

// Cabeceras adicionales
$cabeceras .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' "\r\n";
$cabeceras .= 'From: Recordatorio <cumples@example.com>' "\r\n";
$cabeceras .= 'Cc: birthdayarchive@example.com' "\r\n";
$cabeceras .= 'Bcc: birthdaycheck@example.com' "\r\n";

// Mail it
mail($para$titulo$mensaje$cabeceras);
?>



Respuesta: Me ayudan PHP?= - benjas09 - 28.11.2010

el problema es qe nose como hago esto.
Viste qe arriba tengo para seleccionar, como hago para qe PHP lo reconosca? a lo que hans eleccionado


Re: Me ayudan PHP?= - SuperMarioRol - 28.11.2010

Usa [*php] [*/php]


Respuesta: Me ayudan PHP?= - benjas09 - 28.11.2010

El de arriba es html no php xD


Respuesta: Me ayudan PHP?= - SuperMarioRol - 28.11.2010

Ah ok, perdon xD