Foros del Web » Programando para Internet » PHP »

Codigo inoperante

Estas en el tema de Codigo inoperante en el foro de PHP en Foros del Web. Saludos programadores, tengo un problema con un código php y no se que es lo que esta mal. Es un form que esta en una ...
  #1 (permalink)  
Antiguo 05/11/2008, 16:16
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Codigo inoperante

Saludos programadores, tengo un problema con un código php y no se que es lo que esta mal. Es un form que esta en una pàgina, esta llama al php encargado de: Mandarle a la persona que escribió un correo dándole las gracias y otro a la empresa con los datos llenos del form, el problema es que no esta haciendo ninguno de los dos, cuando se presiona el botón submit ni siquiera aparece la información que le puse ahí ni re-direcciona la página de vuelta. Ahi pongo el código del form y el php a ver si ustedes ven en que estoy mal.
Gracias:

Código HTML:
<form METHOD="post" ACTION="send_pledge.php">
<div align="left"><table width="69%" border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td width="50%" align="right"><span class="style5"><font color="#000000"><small>Name</small></font></span></td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="name"size="40"></font></td>
</tr>
<tr>
<td width="50%" align="right"><div align="right"><p class="style5"><font color="#000000"><small>Billing address</small></font></td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="billing"size="40"></font></td>
</tr>
<tr>
<td width="50%" align="right"><span class="style5">City</span></td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="city"size="40"></font></td>
</tr>
<tr>
<td width="50%" align="right"><span class="style5">State</span></td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="state"size="40"></font></td>
</tr>
<tr>
<td width="50%" align="right"><span class="style5"><font color="#000000"><small>Zip Code</small></font></span></td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="zip_code"size="40">
</font></td>
</tr>
<tr>
<td width="50%" align="right"><span class="style5">Telephone (home)</span></td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="phone_home"size="40" id="phone_home">
</font></td>
</tr>
<tr>
<td width="24%" align="right"><span class="style5">Telephone (business)</span></td>
<td width="28%"><font color="#FFFFFF" face="Arial"><input type="text" name="phone_business"size="40" id="phone_business">
</font></td>
</tr>
<tr>
<td width="20%" align="right"><span class="style5">Fax</span></td>
<td width="28%"><font color="#FFFFFF" face="Arial"><input type="text" name="fax"size="40">
</font></td>
</tr>
<tr>
<td width="24%" align="right"><span class="style5">E-Mail</span></td>
<td width="28%"><font color="#FFFFFF" face="Arial"><input type="text" name="email"size="40">
</font></td>
</tr>
</table>
<br>
<br>
<table align="center">
<td><div>
<div align="center"><strong>Pledge Information</strong><br>
</div>
<p>I (we) pledge a total of $&nbsp;<input name="amount" type="text" size="7" maxlength="10">&nbsp;to be paid:<br>
</p>
<table width="200">
  <tr>
    <td><span class="style5">
      <label>
        <input type="radio" name="time" value="now" id="RadioGroup1_0">
        Now</label>
    </span></td>
  </tr>
  <tr>
    <td><span class="style5">
      <label>
        <input type="radio" name="time" value="monthly" id="RadioGroup1_1">
        monthly</label>
    </span></td>
  </tr>
  <tr>
    <td><span class="style5">
      <label>
        <input type="radio" name="time" value="quarterly" id="RadioGroup1_2">
        quarterly</label>
    </span></td>
  </tr>
  <tr>
    <td><span class="style5">
      <label>
        <input type="radio" name="time" value="yearly" id="RadioGroup1_3">
        yearly</label>
    </span></td>
  </tr>
</table>
<p><br>
  I (we) plan to make this contribution in the form of:<br>
  </p>
<table width="200">
  <tr>
    <td><span class="style5">
      <label>
        <input type="radio" name="plan" value="cash" id="RadioGroup2_0">
        Cash</label>
    </span></td>
  </tr>
  <tr>
    <td><span class="style5">
      <label>
        <input type="radio" name="plan" value="check" id="RadioGroup2_1">
        Check</label>
    </span></td>
  </tr>
  <tr>
    <td><span class="style5">
      <label>
        <input type="radio" name="plan" value="creditcard" id="RadioGroup2_2">
        Credit Card</label>
    </span></td>
  </tr>
  <tr>
    <td><span class="style5">
      <label>
        <input type="radio" name="plan" value="other" id="RadioGroup2_3">
        Other</label>
    </span></td>
  </tr>
</table>
</div></td>
</table>
<br>
<div align="left"><table width="69%" border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td width="50%" align="right"><span class="style5 style5">Credit card type</span></td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="card_type"size="40" id="card_type">
</font></td>
</tr>
<tr>
<td width="50%" align="right"><div align="right"><p class="style5 style5">Credit card number</td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="card_number"size="40" id="card_number">
</font></td>
</tr>
<tr>
<td width="50%" align="right"><span class="style5">Expiration date</span></td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="expiration_date"size="40"></font></td>
</tr>
<tr>
<td width="50%" align="right"><span class="style5">Authorized signature</span></td>
<td width="50%"><font color="#FFFFFF" face="Arial"><input type="text" name="signature"size="40" id="signature">
</font></td>
</tr>
</table>
<table align="center">
<td>
<div>
  <p>Gift will be matched by&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <input name="gift" type="text" size="20" maxlength="20"> 
    </p>
  <p>(company/family/foundation).
    &nbsp;
    <input name="company" type="text" size="20" maxlength="20" id="company">
    </p>
  <p>Form enclosed&nbsp;&nbsp;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
  <input name="enclosed" type="text" size="20" maxlength="20" id="enclosed"> 
    form will be forwarded.   </p>
  <p class="style1"> Acknowledgement Information    </p>
  <p>Please use the following name(s) in all acknowledgements:    </p>
  
    <label>
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
     <input name="all_name" type="text" id="all_name" size="30" maxlength="35">
      </label>
    <br>
    <p>I (we) wish to have our gift remain anonymous.    </p>
      
      <label>Signature(s)
      <input name="signature2" type="text" id="signature2" size="30" maxlength="30">
</label><br><br>
      <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date
      <input name="date" type="text" id="date" size="30" maxlength="35">
      </label>
      <div align="center"><br>
        <strong>Please make checks, corporate matches, or other gifts payable to:</strong><br><br>
        <em>DHails Community Ehancement Services, Inc.<br>
        2101 Vista Parkway, Ste. #255<BR>
        West Palm Beach, Florida 33411        </em> </div>
</div></td></table>


<p align="center">
  <label>
  <input type="submit" value="Submit">
  </label>
</p>
</div>
</form> 
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr

Última edición por gVenom; 05/11/2008 a las 16:35
  #2 (permalink)  
Antiguo 05/11/2008, 16:16
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Codigo inoperante

y el PHP:

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META HTTP-EQUIV="Refresh" CONTENT="7;URL=http://www.dceservices.com/index.html">  
<title>Send_pledge</title>
<style type="text/css">
.style1 {
    color:#0000FF;
    font-weight: bold;
}
.style2 {color: #FF0000}
</style>
</head>

<body>
<p>&nbsp;</p>
  <?php
  
                  
////////////////////Aqui va la respuesta inmediata al cliente//////////////
$email $_POST["email"] ;
$myname "DHails Community Enhancement Services,*Inc." ;
$myemail "[email protected];
$subject "Pledge form Received. " ;
$body "Dear $name \n
We have received your information. Thank you. 


Respectfully

Denise Edwards-Hails.
Founder and CEO of DHails Community Enhancement Services,*Inc. 


www.dceservices.org "
*;



$headers "Content-Type: text/plain; charset=us-ascii\nFrom: $myname <$myemail>\nReply-To: <$myemail>\nReturn-Path: <$myemail>\nX-Mailer: PHP";
mail($email,$subject,$body,$headers);



                                                  
$myemail "[email protected]"
                                                  
                     
///////// Aqui va lo que se llena en el formulario  //////////
                     
                     
if (!isset($visitormail)) 
echo 
" www.dceservices.com " 
$todayis date("m d Y") ;
$subject "$name , From Your Web Page" ;
$message " $todayis [EST] \n
Name: $name \n
Billing address: $billing \n
City: $city \n
State: $state \n
Zip Code: $zip_code \n
Home Telephone: $phone_home \n
Business Telephone: $phone_business \n
Fax: $fax \n
E-Mail: $email \n

Pledge Information \n
I (we) pledge a total of \n
$amount \n
Dolars. to be paid: \n
$time \n

I (we) plan to make this contribution in the form of: \n

     $plan \n



Credit card type:     $card_type \n
Credit card number:   $card_number \n
Expiration date:      $expiration_date \n
Authorized signature: $signature \n

Gift will be matched by*:  $gift \n

(company/family/foundation): $company \n

Form enclosed: $enclosed

*form will be forwarded.  \n 

Acknowledgement Information \n

Please use the following name(s) in all acknowledgements: 
$all_name
I (we) wish to have our gift remain anonymous. 

Signature(s) :  $signature2 \n
Date:  $date \n 
Date: $todayis \n
RECIEVED CHURCH ACTIVITIES DATA BASE ;

Referral : $httpref \n
"
;
$from "From: $myemail\r\n";
if (
$myemail != ""
mail($myemail$subject$message$from);
?>
<p>&nbsp;</p>
<p align="center" class="style1"><strong>Thanks by send the Pledge information</strong></p>
<p align="center" class="style1"><strong>We will E-Mail you soon</strong></p>
<p align="center" class="style1">If you do not see an email in your inbox please check your spawn email box</p>
</body>
</html>
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr
  #3 (permalink)  
Antiguo 05/11/2008, 16:54
Avatar de jaronu  
Fecha de Ingreso: febrero-2008
Mensajes: 2.183
Antigüedad: 16 años, 2 meses
Puntos: 52
Respuesta: Codigo inoperante

hola

no te veo hacer ningun echo para imprimir algo en pantalla, tampoco ninguna funcion de redireccion a ninguna parte, y has provado en enviar un email sencillo, vaya a ser que tu hosting tenga deshabilitada la funcion mail

Prueba un mail muy basico

mail("tu_email", "un asunto","un mensaje");

si no te envia eso no te enviara nada.
  #4 (permalink)  
Antiguo 05/11/2008, 18:51
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Respuesta: Codigo inoperante

Cita:
Iniciado por jaronu Ver Mensaje
hola

no te veo hacer ningun echo para imprimir algo en pantalla, tampoco ninguna funcion de redireccion a ninguna parte, y has provado en enviar un email sencillo, vaya a ser que tu hosting tenga deshabilitada la funcion mail

Prueba un mail muy basico

mail("tu_email", "un asunto","un mensaje");

si no te envia eso no te enviara nada.
Saludos. no utilizo echo si no que el texto que aparece al enviar el email esta directo en la página, porque no ocupo recuperar ningún dato en la página que envía el email en la pantalla. La página la redirecciono con un meta:
Código HTML:
<META HTTP-EQUIV="Refresh" CONTENT="7;URL=http://www.dceservices.com/index.html"> 
y eso funciona bien. Ahora lo curioso es lo que estoy viendo aqui mismo en estos posteos de el tema, el codigo despliega esto:

Código PHP:
www.dceservices.org "*; 
Código PHP:
$myname "DHails Community Enhancement Services,*Inc." 
donde esa * que aparece ahí imagino que es un espacio en blanco que le dí con el tabulador. Pregunta: Puede afectar eso en el funcionamiento del código?
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr
  #5 (permalink)  
Antiguo 06/11/2008, 10:15
 
Fecha de Ingreso: abril-2003
Ubicación: Mexico
Mensajes: 604
Antigüedad: 21 años
Puntos: 23
Respuesta: Codigo inoperante

buenas!!

la respuesta es "SI"

recuerda que php es un lenguaje de programacion y cuando programamos no deve existir NADA mas que el codigo que se ejecuta
y en el caso de comentarios con la respectiva asignacion como tal

un saludo!!
__________________
¡El Respeto al Derecho Ajeno Es la Paz!
  #6 (permalink)  
Antiguo 06/11/2008, 10:20
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Respuesta: Codigo inoperante

Ok, gracias ya salí de esa, ahora estoy con otro posteo de "header de php como desplegarlo"
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr
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 04:38.