Foros del Web » Programando para Internet » PHP »

cuerpo y mysql

Estas en el tema de cuerpo y mysql en el foro de PHP en Foros del Web. php .$row_mail['nombre'];"\n".$row_mail['mail'];"\n".$row_mail['telefono'];"\n".$row_mail['numero'];"\n".$row_mail['fecha']; es muy error Código PHP: <?php  require_once( 'Connections/word.php' );  ?> <?php if (! function_exists ( "GetSQLValueString" )) { function  GetSQLValueString ( $theValue ,  $theType ,  ...
  #1 (permalink)  
Antiguo 29/10/2013, 06:12
 
Fecha de Ingreso: abril-2013
Mensajes: 39
Antigüedad: 11 años
Puntos: 0
cuerpo y mysql

php .$row_mail['nombre'];"\n".$row_mail['mail'];"\n".$row_mail['telefono'];"\n".$row_mail['numero'];"\n".$row_mail['fecha']; es muy error
Código PHP:
<?php require_once('Connections/word.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$colname_mail "-1";
if (isset(
$_GET['id'])) {
  
$colname_mail $_GET['id'];
}
mysql_select_db($database_word$word);
$query_mail sprintf("SELECT * FROM reservas WHERE id = %s"GetSQLValueString($colname_mail"int"));
$mail mysql_query($query_mail$word) or die(mysql_error());
$row_mail mysql_fetch_assoc($mail);
$totalRows_mail mysql_num_rows($mail);
?>
<? 
$destinatario 
"[email protected]"
$asunto "nombre"$row_mail['nombre'] ; 
$cuerpo "
<head>
<title>Documento sin título</title>
</head>

<body>


<h1>Hola amigos!</h1> 
<p>"
.$row_mail['nombre'];"\n".$row_mail['mail'];"\n".$row_mail['telefono'];"\n".$row_mail['numero'];"\n".$row_mail['fecha'];"
</p> 
</body> 
</html> 
"
;

//para el envío en formato HTML 
$headers "MIME-Version: 1.0\r\n"
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"

//dirección del remitente 
$headers .= "From: Miguel Angel Alvarez <[email protected]>\r\n"

//dirección de respuesta, si queremos que sea distinta que la del remitente 
$headers .= "Reply-To: [email protected]\r\n"


mail($destinatario,$asunto,$cuerpo,$headers
?>
</body>
</html>
<?php
mysql_free_result
($mail);
?>
  #2 (permalink)  
Antiguo 29/10/2013, 08:04
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: cuerpo y mysql

El punto y coma ; es el caracter que usa PHP para indicar fin de línea, todo lo que iene después, si no está codificado correctamente es un error.

<p>".$row_mail['nombre'];"\n".$row_mail['mail'];"\n".$row_mail['telefono'];"\n".$row_mail['numero'];"\n".$row_mail['fecha'];"

Todos los ; marcados deberían ser . para concatenar.
__________________
- León, Guanajuato
- GV-Foto
  #3 (permalink)  
Antiguo 29/10/2013, 13:45
 
Fecha de Ingreso: abril-2013
Mensajes: 39
Antigüedad: 11 años
Puntos: 0
Respuesta: cuerpo y mysql

soy torpe poco, muchos gracias

Etiquetas: cuerpo, fecha, html, mysql, select, sql
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:07.