Foros del Web » Programando para Internet » PHP »

problemas con formulario al poner register_globals = Off

Estas en el tema de problemas con formulario al poner register_globals = Off en el foro de PHP en Foros del Web. Hola amigos, por motivos de seguridad me reocmendaro poner register_globals = Off lo que sucede ahora es que los formularios que tenia funcionando simplemente ahora ...
  #1 (permalink)  
Antiguo 12/02/2009, 16:21
Avatar de eschwartz  
Fecha de Ingreso: enero-2002
Ubicación: Chosica
Mensajes: 1.098
Antigüedad: 22 años, 4 meses
Puntos: 8
problemas con formulario al poner register_globals = Off

Hola amigos, por motivos de seguridad me reocmendaro poner register_globals = Off lo que sucede ahora es que los formularios que tenia funcionando simplemente ahora no se envian, uso phpmailer para enviar los formularios y aun no encuentro una solucion a esto.

mi formulario es el siguiente:
Código PHP:
<form action="respuesta.php"  accept-charset="text/html" method="POST" name ="registro" onsubmit="MM_validateForm('nombres','','R','apellidos','','R','email','','RisEmail','facultad','','R');return document.MM_returnValue">
                            <
table width="100%" height="229" border="0" align="center" cellspacing="1">
                               <
tr>
                                <
td height="25"></td>
                                <
td height="25" align="center" valign="top" class="Estilo41">&nbsp;</td>
                                <
td height="25" class="Estilo41">&nbsp;</td>
                                <
td height="25" class="Estilo35">Bach.<strong>
                                    <
input name="grado" type="radio" value="Bach." checked="CHECKED" />
                                </
strong>Lic.<strong>
                                    <
input name="grado" type="radio" value="Lic." />
                                    </
strong>Mg.<strong>
                                      <
input name="grado" type="radio" value="Mg." />
                                </
strong>Dr.<strong>
                                <
input name="grado" type="radio" value="Dr." />
                                </
strong></td>
                                <
td height="25"></td>
                              </
tr>
                              <
tr>
                                <
td width="10%" height="25"></td>
                                <
td width="24%" height="25" class="Estilo35">Nombres <span class="Estilo43">*</span></td>
                                <
td width="5%" height="25" class="Estilo41">:</td>
                                <
td width="53%" height="25" class="Estilo35"><input name="nombres" type="text" style="border: 1 solid #003D59" size="30" /></td>
                                <
td width="8%" height="25"></td>
                              </
tr>
                              <
tr>
                                <
td width="10%" height="25"></td>
                                <
td width="24%" height="25" class="Estilo35">Apellidos <span class="Estilo43">*</span></td>
                                <
td width="5%" height="25" class="Estilo41">:</td>
                                <
td width="53%" height="25" class="Estilo35"><input name="apellidos" type="text" style="border: 1 solid #003D59" size="30" /></td>
                                <
td width="8%" height="25"></td>
                              </
tr>
                              <
tr>
                                <
td width="10%" height="25"></td>
                                <
td width="24%" height="25" class="Estilo35">Correo electr&oacute;nico <span class="Estilo43">*</span></td>
                                <
td width="5%" height="25" class="Estilo41">:</td>
                                <
td width="53%" height="25" class="Estilo35"><input name="email" type="text" style="border: 1 solid #003D59" size="30" /></td>
                                <
td width="8%" height="25"></td>
                              </
tr>
                              <
tr>
                                <
td width="10%" height="25"></td>
                                <
td width="24%" height="25" class="Estilo35">Dirección<span class="Estilo43"> *</span></td>
                                <
td width="5%" height="25" class="Estilo41">:</td>
                                <
td width="53%" height="25" class="Estilo35"><input name="direccion" type="text" style="border: 1 solid #003D59" size="30" /></td>
                                <
td width="8%" height="25"></td>
                              </
tr>
                              
                              <
tr>
                                <
td height="25"></td>
                                <
td height="25" class="Estilo35">Modelo de P&aacute;gina Personal </td>
                                <
td height="25" class="Estilo41">:</td>
                                <
td height="25" class="Estilo35"><label>
                                  <
select name="modelo" size="1" class="Estilo6">
                                    <
option value="Modelo (1) - Karma Soul" selected="selected">Modelo (1) - Karma Soul</option>
                                    <
option value="Modelo (2) - A-Blue CR7">Modelo (2) - A-Blue CR7</option>
                                    <
option value="Modelo (3) - Asterix">Modelo (3) - Asterix</option>
                                    <
option value="Modelo (4) - Terran C3">Modelo (4) - Terran C3</option>
                                    <
option value="Modelo (5) - Mystery">Modelo (5) - Mystery</option>
                                    <
option value="Modelo (6) - Frozen">Modelo (6) - Frozen</option>
                                    <
option value="Modelo (7) - Nikita">Modelo (7) - Nikita</option>
                                    <
option value="Modelo (8) - Paradise">Modelo (8) - Paradise</option>
                                    <
option value="Modelo (9) - Venus Pink">Modelo (9) - Venus Pink</option>
                                    <
option value="Modelo (10) - Digital Hand">Modelo (10) - Digital Hand</option>
                                    </
select>
                                </
label>
                                  <
br />
                                  <
a href="modelosweb.php" target="_blank">[ver modelos disponibles] </a></td>
                                <
td height="25"></td>
                              </
tr>
                              <
tr>
                                <
td width="10%" height="17"></td>
                                <
td width="24%" height="17" class="Estilo35">Comentario</td>
                                <
td width="5%" height="17" class="Estilo41">:</td>
                                <
td width="53%" height="17" class="Estilo35"><span style="font-weight: bold">
                                  <
textarea rows="6" name="consulta" cols="30" style="border: 1 solid #003D59"></textarea>
                                </
span></td>
                                <
td width="8%" height="17"></td>
                              </
tr>
                              <
tr>
                                <
td width="10%" height="17"></td>
                                <
td width="24%" height="17" class="Estilo41"></td>
                                <
td width="5%" height="17" class="Estilo41"></td>
                                <
td width="53%" height="17" class="Estilo35"><class="Estilo35">(<span class="Estilo43">*</span>) Campos Obligatorios </p>
                                
                                    <
p>&nbsp;</p></td>
                                <
td width="8%" height="17"></td>
                              </
tr>
                              <
tr>
                                <
td width="10%" height="17"></td>
                                <
td height="17" colspan="3"><p align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                  <
label>
                                  <
input name="Submit" type="submit" class="Estilo35" value="Enviar Solicitud" /> 
                                  </
label>&nbsp;
                                  <
label>
                                  <
input name="reset" type="reset" class="Estilo35" value="Restablecer" />
                                  </
label>
                                </
p>                                  </td>
                                <
td width="8%" height="17"></td>
                              </
tr>
                            </
table></form

y el que procesa los datos de formulario es respuesta.php


Código PHP:
<?

require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->Mailer "smtp";

  
//Asignamos a Host el nombre de nuestro servidor smtp
  
$mail->Host "server_smtp";

  
//Le indicamos que el servidor smtp requiere autenticación
  
$mail->SMTPAuth true;

  
//Le decimos cual es nuestro nombre de usuario y password
  
$mail->Username "usuario"
  
$mail->Password "contraseña";
 
$mail->From "contacto@midominio";
$mail->FromName "Solicitud Electronica";
$mail->Subject "Mensaje de Formulario Web";
$mail->AddAddress("[email protected]");
$mail->AddCC("[email protected]");
$mail->AddBCC($email);
 
$body  "FORMULARIO WEB  \n\n";
$body .= "Nombres         :  ".$nombres"\n";
$body .= "Apellidos       :  ".$apellidos"\n";
$body .= "Dirección        :  ".$dirección"\n";
$body .= "Modelo          :  ".$modelo"\n";
$body .= "Correo          :  ".$email"\n";
$body .= "Mensaje         :  ".$consulta"\n";
$mail->Body $body;
$mail->Send(); 
?>

que variables debo modificar para enviar el mismo formulario estando _globals = Off en mi php.ini

Espero me puedan ayudar o darme algun alcance.
Muchas gracias.

Slds.
__________________
"Si miras fijamente la realidad, veras los pixeles"
------------------------------------------------------------------
ESOFT - SCHWARTZ GROUP ©
http://www.esoft.host56.com/
  #2 (permalink)  
Antiguo 12/02/2009, 16:33
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: problemas con formulario al poner register_globals = Off

Para todas las variables que recibes desde el formulario tienes que inicializarlas asi:

Código php:
Ver original
  1. $variable = $_POST['variable'];
__________________
- León, Guanajuato
- GV-Foto
  #3 (permalink)  
Antiguo 12/02/2009, 17:09
Avatar de eschwartz  
Fecha de Ingreso: enero-2002
Ubicación: Chosica
Mensajes: 1.098
Antigüedad: 22 años, 4 meses
Puntos: 8
Respuesta: problemas con formulario al poner register_globals = Off

Cita:
Iniciado por Triby Ver Mensaje
Para todas las variables que recibes desde el formulario tienes que inicializarlas asi:

Código php:
Ver original
  1. $variable = $_POST['variable'];

Muchas gracias triby, excelente. ...todo funciono bien....he considerado todas las variables que recibo del formulario y las he inicializado tal como me lo dijiste, pero como haria en el caso de la parte de las copias de envio de correo que estoy considerando en el respuesta.php, porque solo me envia a la direccion de correo que recibo desde el formulario y no las que considero en el respuesta.php

Espero me eches una mano.

Slds.
__________________
"Si miras fijamente la realidad, veras los pixeles"
------------------------------------------------------------------
ESOFT - SCHWARTZ GROUP ©
http://www.esoft.host56.com/

Última edición por eschwartz; 12/02/2009 a las 17:21
  #4 (permalink)  
Antiguo 12/02/2009, 18:07
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: problemas con formulario al poner register_globals = Off

No he usado mucho PHPMailer, pero parece que si estas usando correctamente todas las opciones.

Te da algun mensaje de error?
Código php:
Ver original
  1. echo $mail->ErrorInfo;
__________________
- León, Guanajuato
- GV-Foto
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:58.