PHP - ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

 
Vista:
Imágen de perfil de Cristhian Fernando
Val: 16
Ha aumentado su posición en 10 puestos en PHP (en relación al último mes)
Gráfica de PHP

ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

Publicado por Cristhian Fernando (5 intervenciones) el 07/06/2019 14:50:50
Buen día
requiero su colaboración sobre un inconveniente que tengo en la elaboración de un formulario de registro para la empresa en que laboro actualmente, ya tengo el formulario elaborado, pero tengo inconveniente con insertar datos a una base y que este también me envíe el formulario a través de un correo.
en una base de pruebas si puedo insertar datos y enviar correos, pero cuando la monto a la base de producción, es donde se presentan los inconvenientes.
adjunto los archivos de la pagina de producción en donde esta alojado,
index
formulario_beneficio
procesar_formulario
para que por favor me instruyan si estoy cometiendo algún error
de antemano agradezco la ayuda prestada
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Kevin
Val: 87
Ha aumentado su posición en 3 puestos en PHP (en relación al último mes)
Gráfica de PHP

ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

Publicado por Kevin (14 intervenciones) el 07/06/2019 15:02:57
¡Saludos!

Creo que te ayudaríamos mucho más rápido si cuelgas parte del código donde te da el error acá, se haría un poco más fluido y muchas más personas podrían colaborar.

Si puedes colgar acá el código, te intento ayudar c:
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
3
Comentar
Imágen de perfil de Cristhian Fernando
Val: 16
Ha aumentado su posición en 10 puestos en PHP (en relación al último mes)
Gráfica de PHP

ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

Publicado por Cristhian Fernando (5 intervenciones) el 07/06/2019 15:21:50
ESTE ES EL CODIGO DEL FORMULARIO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/MRTemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head><meta http-equiv="Content-Type" content="text/html; charset=gb18030">
 
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
 
 
<meta name="keywords" content="cooperativa, multiactiva, entidad, el roble, multiroble, juanchaco, credito, ahorro, inversion, fomento" />
<meta name="description" content="En Multiactiva El Roble, Entidad Cooperativa, nos preocupamos por el Fomento Empresarial, Creditos, Ahorro e Inversi�1�7n, Educaci�1�7n y Recreacion." />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Multiactiva El Roble</title>
<link href="estilos-tablas.css" rel="stylesheet" type="text/css">
 
<!--
<!-- InstanceEndEditable -->
<link href="CSS-Multirobles.css" rel="stylesheet" type="text/css" />
<link href="Sprys/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="Persiana_horizontal/estilos1-persiana.css" />
<link rel="stylesheet" type="text/css" href="Persiana_horizontal/estilos2-persiana.css" />
<script src="Sprys/SpryMenuBar.js" type="text/javascript"></script>
<!--[if IE]>
<script defer type="text/javascript" src="scripts/pngfix.js"></script>
<![endif]-->
<!-- InstanceBeginEditable name="head" -->
<link href="print_css.css" rel="stylesheet" type="text/css" media="print">
<link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationRadio.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
<!-- InstanceParam name="OptionalRegion1" type="boolean" value="true" -->
</head>
 
<body>
    <form name="form1" method="POST" action="procesar_formulario_inscripcion.php">
        <table cellspacing="0" cellpadding="4" id="tablaMR7">
            <tr>
               <th colspan="4">Formulario para acceder al beneficio.</th>
            </tr>
            <tr>
                <th colspan="4" align="left">DATOS BASICOS ASOCIADO</th>
            </tr>
            <tr>
                <td>Tipo de documento</td>
                <td>
                <span id="spryradio1">
                    <label>
                      C.C.<input type="radio" name="tipo_id" value="C.C.">
                    </label>
                    <label>
                      C.E.<input type="radio" name="tipo_id" value="C.E.">
                    </label>
                    <label>
                      T.I.<input type="radio" name="tipo_id" value="T.I.">
                    </label>
                 </span>
                </td>
 
                <td>No DOCUMENTO</td>
                <td>
                   <span id="sprytextfield1">
                       <input type="text" name="id_asoc" maxlength="">
                   </span>
                </td>
            </tr>
            <tr>
                <td>NOMBRES:</td>
                <td>
                <span id="sprytextfield2">
                  <input type="text" name="nom_asoc">
                </span>
                </td>
                <td>APELLIDOS:</td>
                <td>
                <span id="sprytextfield3">
                    <input type="text" name="ape_asoc">
                </span>
                </td>
            </tr>
            <tr>
                <td>DIRECCION:</td>
                <td>
                <span id="sprytextfield4">
                  <input type="text" name="direccion">
                </span>
                </td>
                <td>TELEFONO:</td>
                <td>
                <span id="sprytextfield5">
                  <input type="tel" name="tel_asoc">
                </span>
                </td>
            </tr>
            <tr>
               <td>CELULAR:</td>
               <td>
               <span id="sprytextfield6">
               <input type="tel" name="celular">
               </span>
               </td>
 
                <td>ESTRATO:</td>
                <td>
                <span id="spryradio2">
                <label>
                1.<input type="radio" name="estrato" value="1">
                </label>
                <label>
                2.<input type="radio" name="estrato" value="2">
                </label>
                <label>
                3.<input type="radio" name="estrato" value="3">
                </label>
                <label>
                4.<input type="radio" name="estrato" value="4">
                </label>
                <label>
                5.<input type="radio" name="estrato" value="5">
                </label>
                <label>
                6.<input type="radio" name="estrato" value="6">
                </label>
                </span>
                </td>
            </tr>
            <tr>
              <td>CIUDAD RESIDENCIA:</td>
              <td>
              <span id="sprytextfield7">
              <input type="text" name="ciudad_asoc">
              </span>
              </td>
              <td>DEPARTAMENTO RESIDENCIA:</td>
              <td>
              <span id="sprytextfield8">
              <input type="text" name="dpto_asoc">
              </span>
              </td>
           </tr>
           <tr>
              <td>EMPRESA DONDE LABORA:</td>
              <td>
              <span id="sprytextfield9">
              <input type="text" name="empr_asoc">
              </span>
              </td>
              <td>TELEFONO EMPRESA (EXT):</td>
              <td>
              <span id="sprytextfield10">
              <input type="tel" name="tel_empr">
              </span>
              </td>
            </tr>
             <tr>
              <td>EMAIL:</td>
              <td colspan="3">
              <span id="sprytextfield11">
              <input type="email" name="email_asoc">
              </span>
              </td>
             </tr>
             <tr>
              <td>CODICION ASOCIADO:</td>
              <td colspan="4">
               <span id="spryradio3">
               <label>
               1: DESEMPLEADO<input type="radio" name="cond_asoc" value="DESEMPLEADO">
               </label>
               <label>
               2: CABEZA DE HOGAR<input type="radio" name="cond_asoc" value="CABEZA DE HOGAR">
               </label>
               <label>
               3: ASOCIADO ACTIVO<input type="radio" name="cond_asoc" value="ASOCIADO ACTIVO">
               </label>
               </span>
              </td>
             </tr>
             <tr>
                 <th colspan="4" align="left">DATOS DEL BENEFICIARIO</th>
             </tr>
             <tr>
               <td>PARENTEZCO CON ASOCIADO:</td>
                 <td>
                 <span id="sprytextfield12">
                 <input type="text" name="parentezco">
                 </span>
                 </td>
                 <td>EMAIL:</td>
                 <td>
                 <span id="sprytextfield13">
                 <input type="email" name="email_bene">
                 </span>
                </td>
             </tr>
             <tr>
                <td>NOMBRES:</td>
                <td>
                <span id="sprytextfield14">
                <input type="text" name="nom_bene">
                </span>
                </td>
                <td>APELLIDOS:</td>
                <td>
                <span id="sprytextfield15">
                <input type="text" name="ape_bene">
                </span>
                </td>
              </tr>
              <tr>
                 <td>FECHA DE NACIMIENTO (mm/dd/aaaa):</td>
                 <td colspan="4">
                 <span id="sprytextfield16">
                 <input type="date" name="fecha">
                 </span>
                 </td>
              </tr>
 
              <tr>
                <td>Tipo de documento</td>
                <td>
                <span id="spryradio4">
                <label>
                 C.C.<input type="radio" name="tipo_doc" value="C.C.">
                 </label>
                 <label>
                 C.E.<input type="radio" name="tipo_doc" value="C.E.">
                 </label>
                 <label>
                 T.I.<input type="radio" name="tipo_doc" value="T.I.">
                 </label>
                 <label>
                 R.C.<input type="radio" name="tipo_doc" value="R.C.">
                 </label>
                 </span>
             </td>
             <td>No DOCUMENTO </td>
                 <td>
                 <span id="sprytextfield17">
                 <input type="text" name="id_bene">
                 </span>
                 </td>
             </tr>
             <tr>
                <td>CIUDAD RESIDENCIA:</td>
                <td>
                <span id="sprytextfield18">
                <input type="text" name="ciudad_bene">
                </span>
                </td>
                <td>DEPARTAMENTO RESIDENCIA:</td>
                <td>
                <span id="sprytextfield19">
                <input type="text" name="dpto_bene">
                </span>
                </td>
             </tr>
             <tr>
               <td>DIRECCION:</td>
               <td>
               <span id="sprytextfield20">
               <input type="text" name="dir_bene">
               </span>
               </td>
               <td>TELEFONO:</td>
               <td>
               <span id="sprytextfield21">
               <input type="tel" name="tel_bene">
               </span>
               </td>
               </tr>
             <tr>
               <td>CELULAR:</td>
               <td colspan="4">
               <span id="sprytextfield22">
               <input type="tel" name="cel_bene">
               </span>
               </td>
             </tr>
             <tr>
               <td>No DE CUENTA (Beneficiario):</td>
               <td>
               <span id="sprytextfield23">
               <input type="text" name="cuenta">
               </span>
               </td>
               <td>TIPO DE CUENTA:</td>
               <td>
               <span id="spryradio5">
               <label>
                AHORROS<input type="radio" name="tipo_cuenta" value="AHORROS">
                </label>
                <label>
                CORRIENTE<input type="radio" name="tipo_cuenta" value="CORRIENTE">
                </label>
                </span>
                </td>
               </tr>
               <tr>
                 <td>ENTIDAD DONDE TIENE LA CUENTA:</td>
                 <td colspan="4">
                 <span id="sprytextfield24">
                 <input type="tel" name="banco">
                 </span>
                 </td>
                </tr>
                <tr>
                   <td>ESTRATO:</td>
                   <td colspan="4">
                   <span id="spryradio6">
                   <label>
                   1.<input type="radio" name="est_bene" value="1">
                   </label>
                   <label>
                   2.<input type="radio" name="est_bene" value="2">
                   </label>
                   <label>
                   3.<input type="radio" name="est_bene" value="3">
                   </label>
                   <label>
                   4.<input type="radio" name="est_bene" value="4">
                   </label>
                   <label>
                   5.<input type="radio" name="est_bene" value="5">
                   </label>
                   <label>
                   6.<input type="radio" name="est_bene" value="6">
                   </label>
                   </span>
                   </td>
               </tr>
               <tr>
                  <th colspan="4" align="left">INSTITUCION EDUCATIVA</th>
               </tr>
               <tr>
                 <td colspan="2">
                 <span id="spryradio8">
                 <label>
                 PUBLICA.<input type="radio" name="tip_inst" value="PUBLICA">
                 </label>
                 <label>
                 PRIVADA.<input type="radio" name="tip_inst" value="PRIVADA">
                 </label>
                 </span>
                 </td>
 
                 <td>NOMBRE O RAZON SOCIAL:</td>
                 <td>
                 <span id="sprytextfield26">
                 <input type="tel" name="institucion">
                 </span>
                 </td>
               </tr>
               <tr>
                 <td>NIT:</td>
                 <td>
                 <span id="sprytextfield27">
                 <input type="text" name="nit_inst">
                 </span>
                 </td>
                 <td>SEDE/CIUDAD:</td>
                 <td>
                 <span id="sprytextfield28">
                 <input type="tel" name="sede_inst">
                 </span>
                 </td>
                </tr>
                <tr>
                  <td>TELEFONO:</td>
                  <td>
                  <span id="sprytextfield29">
                  <input type="text" name="tel_inst">
                  </span>
                  </td>
                  <td>DIRECCION:</td>
                  <td>
                  <span id="sprytextfield30">
                  <input type="tel" name="dir_inst">
                  </span>
                  </td>
                </tr>
                <tr>
                   <td>CODIGO DANE (Colegio) O SNIES (Inst. Superior):</td>
                   <td colspan="4">
                   <span id="sprytextfield31">
                   <input type="text" name="cod_inst">
                   </span>
                   </td>
                </tr>
                <tr>
                   <td>GRADO O SEMESTRE A CURSAR:</td>
                   <td>
                   <span id="sprytextfield32">
                   <input type="text" name="grado">
                   </span>
                   </td>
                   <td>PERIODO</td>
                   <td>
                   <span id="sprytextfield33">
                   <input type="text" name="periodo">
                   </span>
                   </td>
                </tr>
                <tr>
                  <td>CARRERA:</td>
                  <td colspan="4">
                  <span id="sprytextfield34">
                  <input type="text" name="carrera">
                  </span>
                  </td>
                 </tr>
                 <tr>
                   <td>DURACION DEL GRADO O CARRERA:</td>
                   <td>
                   <span id="sprytextfield35">
                   <input type="text" name="duracion">
                   </span>
                   </td>
                   <td>VALOR MATRICULA:</td>
                   <td>
                   <span id="sprytextfield36">
                   <input type="text" name="valor">
                   </span>
                   </td>
                  </tr>
                  <tr>
                     <td colspan="4"><div align="center">Para todos los efectos legales, certifico que la información aquí consignada es veraz.</div></td>
                  </tr>
                  <tr>
                        <td colspan="4"><div align="rigth">FIRMA ASOCIADO</div></td>
                     </tr>
                  <tr>
                        <td colspan="2" align="right"><input name="imprimir" type="button" class="botonesMR" id="imprimir" onclick="window.print();" value="Imprimir" /></td>
                        <td colspan="2" align="left"><input name="button" type="submit" class="botonesMR" id="button" value="Enviar"/></td>
                      </tr>
 
    </table>
 
 
   </form>
 
 
</body>
</html>


ESTE ES EL CODIGO A LA CONEXION A LA BASE DE DATOS DE PRODUCCION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_Multiroble = "localhost";
$database_Multiroble = "formulario_beneficiodb";
#$username_Multiroble = "uuuuuuuu";
#$password_Multiroble = "xxxxxxxxx";
 
$username_Multiroble = "uuuuuuuuu";
$password_Multiroble = "xxxxxxxxxx";
 
//echo "conectado a la base de datos";
 
$Multiroble = mysql_pconnect($hostname_Multiroble, $username_Multiroble, $password_Multiroble) or trigger_error(mysql_error(),E_USER_ERROR);
 
 
 
?>


ESTE ES EL CODGO DONDE SE DEBE DE INSERTAR LOS DATOS Y ENVIAR EL CORREO ELECTRÓNICO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
 
include('cn.php');
 
//recibe los datos y las almacena en las variables.
$tipoid = $_POST["tipo_id"];
$numasoc = $_POST["id_asoc"];
$nombre = $_POST["nom_asoc"];
$apellido = $_POST["ape_asoc"];
$direccion = $_POST["direccion"];
$telefono = $_POST["tel_asoc"];
$celular = $_POST["celular"];
$estrato = $_POST["estrato"];
$ciudad = $_POST["ciudad_asoc"];
$dptamento = $_POST["dpto_asoc"];
$empresa = $_POST["empr_asoc"];
$telempr = $_POST["tel_empr"];
$email = $_POST["email_asoc"];
$condicion = $_POST["cond_asoc"];
$parentbene = $_POST["parentezco"];
$email2 = $_POST["email_bene"];
$nombres2 = $_POST["nom_bene"];
$apellidos2 = $_POST["ape_bene"];
$fecha = $_POST["fecha"];
$tipodoc = $_POST["tipo_doc"];
$num2 = $_POST["id_bene"];
$ciudad2 = $_POST["ciudad_bene"];
$dptamento2 = $_POST["dpto_bene"];
$direccion2 = $_POST["dir_bene"];
$telefono2 = $_POST["tel_bene"];
$celular2 = $_POST["cel_bene"];
$cuentabnk = $_POST["cuenta"];
$tipocta = $_POST["tipo_cuenta"];
$entidad = $_POST["banco"];
$estrat = $_POST["est_bene"];
$tipo2 = $_POST["tip_inst"];
$nominst = $_POST["institucion"];
$nit = $_POST["nit_inst"];
$sede = $_POST["sede_inst"];
$telefono3 = $_POST["tel_inst"];
$direccion3 = $_POST["dir_inst"];
$codigo = $_POST["cod_inst"];
$grado = $_POST["grado"];
$periodo = $_POST["periodo"];
$carrera = $_POST["carrera"];
$duracion = $_POST["duracion"];
$valor = $_POST["valor"];
 
$insertar = "INSERT INTO formulario_beneficio (tipo_identificacion, numero_id, nombres, apellidos, direccion_residencia, telefono_fijo, telefono_celular, estrato, ciudad, departamento,
 nom_empresa, tel_empresa, email, cond_asoc, parentezco, email_bene, nom_beneficiario, ape_beneficiario, fecha_naci, tipo_id_bene, numero_id_bene, dto_resudencia, ciudad_residencia, 
 direccion_res_bene, tel_fijo, tel_celular, no_cuenta, tip_cuenta, entidad_banco, estrato_bene, tip_inst, nom_inst, nit, sede_inst, tel_inst, direccion_insti, codigo_inst, grado_semestre, 
 periodo_inst, carrera, duracion_carrera, valor_matricula) VALUES ('$tipoid', '$numasoc', '$nombre', '$apellido', '$direccion', '$telefono', '$celular', '$estrato', '$ciudad', '$dptamento', 
 '$empresa', '$telempr', '$email', '$condicion', '$parentbene', '$email2', '$nombres2', '$apellidos2', '$fecha', '$tipodoc', '$num2', '$dptamento2', '$ciudad2', '$direccion2', '$telefono2', 
 '$celular2', '$cuentabnk', '$tipocta', '$entidad', '$estrat', '$tipo2', '$nominst', '$nit', '$sede', '$telefono3', '$direccion3', '$codigo', '$grado', '$periodo', '$carrera', '$duracion', '$valor')";
 
//ejecutar consulta.
 
$resultado = mysqli_query($conexion, $insertar);
if(!$resultado){
    echo 'Error al registrarse';
}else{
    echo 'Registro realizado satisfactoriamente';
}
 
//Cerrar la conexion.
mysqli_close($conexion);
 
//enviar formulario a un correo electronico especifico
 
//llamamos los campos
 
 
 
//creamos el email al usuario que se esta inscribiendo. 
/**	$to = "cristhian.gutierrez@multiroble.com"; 
    $from = "contacto@multiroble.com";
	if($paraque == "actualizar"){
    $subject = "Actualizacion de datos de Auxilios de Educacion Formal del Asociado No. ".$numasoc; 
	}if($paraque == "renovar"){
    $subject = "Renovacion del Beneficiario para Auxilios de Educacion Formal del Asociado No. "$numasoc; 
	}if($paraque == "inscribir"){
    $subject = "Inscripcion de Nuevo Beneficiario para Auxilios de Educacion Formal del Asociado No. ".$numasoc; 
	}else{
    $subject = "prueba";
	}

//inicio de HTML message 


    $message = "<html><body>
	<table border=\"1\" cellspacing=\"0\" cellpadding=\"1\"><tr><td colspan=\"4\" style=\" background-color:#99CCCC;\">DATOS BASICOS ASOCIADO</td></tr>
	<tr><td>FICHA No</td><td colspan=\"3\">".$numasoc."</td></tr>
	<tr><td>NOMBRES</td><td>".$nombre."</td><td >APELLIDOS</td><td>".$apellido."</td></tr>
	<tr><td >DIRECCION RESIDENCIA</td><td>".$direccion."</td><td>TELEFONO RESIDENCIA</td><td>".$telefono."</td></tr><td>TELEFONO CELULAR</td><td>".$celular."</td></tr>
	<tr><td>ESTRATO</td><td>".$estrato."</td><td>&nbsp;</td><td>&nbsp;</td></tr>
	<tr><td>CIUDAD</td><td>".$ciudad."</td><td>DEPARTAMENTO</td><td>".$dptamento."</td></tr>
	<tr><td>NOMBRE DE LA EMPRESA</td><td>".$empresa."</td><td>TELEFONO EMPRESA (EXT)</td><td>".$telempr."</td></tr>
	<tr><td>E-MAIL</td><td>".$email."</td><td>CONDICI&Oacute;N ASOCIADO</td><td>".$condicion."</td></tr><tr><td colspan=\"4\" style=\" background-color:#99CCCC;\">DATOS DEL BENEFICIARIO</td></tr>
	<tr><td>PARENTEZCO CON ASOCIADO</td><td>".$parentbene."</td><td>E-MAIL</td><td>".$email2."</td></tr>";
	
	$message .= "<tr><td>NOMBRES</td><td>".$nombres2."</td><td>APELLIDOS</td><td>".$apellidos2."</td></tr>
	<tr><td>FECHA DE NACIMIENTO (mm/dd/aaaa)</td><td>".$fecha."</td>
	<tr><td>TIPO DE IDENTIFICACION</td><td>".$tipodoc."</td>
	<td>NUMERO</td><td>".$num2."</td></tr>
	<tr><td>DEPARTAMENTO.</td><td>".$dptamento2."</td><td>CIUDAD DE RESIDENCIA</td><td>".$ciudad2."</td></tr>
	<tr><td>DIRECCION RESIDENCIA.</td><td>".$direccion2."</td><td>TELEFONO FIJO</td><td>".$telefono2."</td></tr><td>TELEFONO CELULAR</td><td>".$tcelular2."</td></tr><td>No DE CUENTA</td><td>".$cuentabnk."</td></tr>
	<td>TIPO DE CUENTA</td><td>".$tipocta."</td></tr><td>ENTINDAD BANCARIA DONDE TIENE LA CUENTA</td><td>".$entidad."</td></tr>
	<tr><td>ESTRATO</td><td colspan=\"3\" >".$estrat."</td></tr><tr><td colspan=\"2\" style=\" background-color:#99CCCC;\">INSTITUCION EDUCATIVA</td><td colspan=\"2\" style=\" background-color:#99CCCC;\">".$tipo2."</td></tr>
	<tr><td>NOMBRE o RAZON SOCIAL</td><td>".$nominst."</td><tr><td>NIT</td><td>".$nit ."</td><td>SEDE/ CIUDAD</td><td>"$sede."</td></tr>";
	
	$message .= "<tr><td>TELEFONO</td><td>".$telefono3."</td><td>DIRECCION</td><td>".$direccion3."</td></tr>
	<td>No DE RESOLUCION</td><td>".$codigo."</td></tr>
   <td>GRADO o SEMESTRE A CURSAR</td><td>".$grado."</td></tr>
	<tr><td>CARRERA</td><td>".$carrera."</td><td>PERIODO</td><td>".$periodo."</td></tr>
	<tr><td>DURACION DEL GRADO O CARRERA</td><td>".$duracion."</td><td>VALOR DE MATRICULA</td><td>".$valor."</td></tr></table></body></html>";

	// creamos los HEADERS

	$headers  = 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";   
	$headers .= 'From: '. $from ."\r\n";
	

    //options to send to cc+bcc 
    //$headers .= "Cc: [email]angelica.sanchez@multiroble.com[/email]"; 
    //$headers .= "Bcc: [email]jose.villegas@multiroble.com[/email]"; 
     
   
   // now lets send the email. 
	if(mail($to, $subject, $message, $headers)){
		// nos dirigimos a la pagina de confirmacion
		header("Location:../renovar_auxilios.php?tag=1"); 
	}else{
		echo "ERROR";
	}
	*/
 
 
?>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Mauro
Val: 2.761
Oro
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

Publicado por Mauro (1036 intervenciones) el 10/06/2019 00:48:14
Dos cosas:

1. No publiques datos sensibles en un foro público (Nombres de usuario/claves)
2. El código que realiza el envío de mail parece estar comentado... si esto es así jamás se realizará el envío.

Aparte, si puedes mostrar algún código de error que estés obteniendo será más fácil comprender la situación y ayudarte a resolverla.

De paso, para envío de mails te recomiendo usar algo diferente de la función mail... Puedes ver más información en https://academy.leewayweb.com/como-enviar-emails-desde-php/
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Cristhian Gutierrez
Val: 16
Ha aumentado su posición en 10 puestos en PHP (en relación al último mes)
Gráfica de PHP

ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

Publicado por Cristhian Gutierrez (5 intervenciones) el 10/06/2019 15:11:38
Buen dia,
de antemano gracias por las recomendaciones, la verdad de tanta cosa y tanta vaina que tengo la verdad se me paso borrar la informacion delicada.

por otro lado encuanto al error que ustd menciona, le comento que cuando en el formulario le doy enviar, esta me lleva a una pagina en donde me sale el error de "error al registrarse" y cuando reviso el link me abre el archivo php en donde tengo el codigo en donde hago el insert de los datos, y los codigos que tengo comentados los puse porque estoy haciendo el ejercicio por pasos, ademas si le quito los comentarios me va aparecer el mismo error.
el codigo donde esta el insert esta ahi mismo como: ESTE ES EL CODGO DONDE SE DEBE DE INSERTAR LOS DATOS Y ENVIAR EL CORREO ELECTRÓNICO

gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Mauro
Val: 2.761
Oro
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

Publicado por Mauro (1036 intervenciones) el 10/06/2019 20:54:24
Ok, comienza por validar que el SQL sea correcto.

Intercala un

1
echo $insertar."<br/>";

En la linea 57 e intenta correr la query directo en la db a ver qué pasa
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Cristhian Fernando Gutiérrez Acosta
Val: 16
Ha aumentado su posición en 10 puestos en PHP (en relación al último mes)
Gráfica de PHP

ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

Publicado por Cristhian Fernando Gutiérrez Acosta (5 intervenciones) el 10/06/2019 22:45:49
buena tarde,
inserte un dato directamente desde la bd, y ese mismo query lo copie y lo pegue al documento php, obviamente cambiandole los valores, por las variables creadas en el php, y me sigue generando error al insertar
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Mauro
Val: 2.761
Oro
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

Publicado por Mauro (1036 intervenciones) el 11/06/2019 16:05:44
Ok... prueba poner:

1
echo("Error description: " . mysqli_error($conexion));

Entre las líneas 59 y 60
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Cristhian Fernando
Val: 16
Ha aumentado su posición en 10 puestos en PHP (en relación al último mes)
Gráfica de PHP

ENVIAR DATOS DE FORMULARIO A UN CORREO ELECTRONICO

Publicado por Cristhian Fernando (5 intervenciones) el 11/06/2019 16:22:21
buen dia, me arroja el error junto con el query de insertar datos, pero lo que me parece raro es que es el mismo que copie del localhostphpmyadmin, envio codigo, para su revision, por favor y me da una pequeña retroalimentación si he fallado en algo, o me he saltado algo estaria completamente agradecido.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$tipoid1 = $_POST["tipo_id"];
$documento1 = $_POST["id_asoc"];
$nombres1 = $_POST["nom_asoc"];
$apellidos1 = $_POST["ape_asoc"];
$direccion1 = $_POST["direccion"];
$telefono1 = $_POST["tel_asoc"];
$celular1 = $_POST["celular"];
$estrato1 = $_POST["estrato"];
$ciudad1 = $_POST["ciudad_asoc"];
$dpto1 = $_POST["dpto_asoc"];
$empresa = $_POST["empr_asoc"];
$telempre = $_POST["tel_empr"];
$email1 = $_POST["email_asoc"];
$condicion = $_POST["cond_asoc"];
$parenasoc = $_POST["parentezco"];
$email2 = $_POST["email_bene"];
$nombres2 = $_POST["nom_bene"];
$apellidos2 = $_POST["ape_bene"];
$nacimiento = $_POST["fecha"];
$tipoid2 = $_POST["tipo_doc"];
$documento2 = $_POST["id_bene"];
$ciudad2 = $_POST["ciudad_bene"];
$dpto2 = $_POST["dpto_bene"];
$direccion2 = $_POST["dir_bene"];
$telefono2 = $_POST["tel_bene"];
$celular2 = $_POST["cel_bene"];
$nocuenta = $_POST["cuenta"];
$tipcta = $_POST["tipo_cuenta"];
$nombanco = $_POST["banco"];
$estrato2 = $_POST["est_bene"];
$tipinsti = $_POST["tip_inst"];
$nominsti = $_POST["institucion"];
$nit = $_POST["nit_inst"];
$sede = $_POST["sede_inst"];
$telefono3 = $_POST["tel_inst"];
$direccion3 = $_POST["dir_inst"];
$codigo = $_POST["cod_inst"];
$grasem = $_POST["grado"];
$periodo1 = $_POST["periodo"];
$carrera1 = $_POST["carrera"];
$tiempocar = $_POST["duracion"];
$matricula = $_POST["valor"];
 
 
 
 
$insertar = "INSERT INTO formulario_beneficio (tipo_identificacion, numero_id, nombres, apellidos, direccion_residencia, telefono_fijo, telefono_celular, estrato, ciudad, departamento, nom_empresa, tel_empresa, email, cond_asoc, parentezco, email_bene, nom_beneficiario, ape_beneficiario, fecha_naci, tipo_id_bene, numero_id_bene, dto_resudencia, ciudad_residencia, direccion_res_bene, tel_fijo, tel_celular, no_cuenta, tip_cuenta, entidad_banco, estrato_bene, tip_inst, nom_inst, nit, sede_inst, tel_inst, direccion_insti, codigo_inst, grado_semestre, periodo_inst, carrera, duracion_carrera, valor_matricula) VALUES ('$tipoid1', '$documento1', '$nombres1', '$apellidos1', '$direccion1', '$telefono1', '$celular1', '$estrato1', '$ciudad1', '$dpto1', '$empresa', '$telempre', '$email1', '$condicion', '$parenasoc', '$email2', '$nombres2', '$apellidos2', '$nacimiento', '$tipoid2', '$documento2', '$dpto2', '$ciudad2', '$direccion2', '$telefono2', '$celular2', '$nocuenta', '$tipcta', '$nombanco', '$estrato2', '$tipinst', '$nominsti', '$nit', '$sede', '$telefono3', '$direccion3', '$codigo', '$grasem', '$periodo1', '$carrera1', '$tiempocar', '$matricula')";
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar