Antes que nada, mil gracias por su atención y tiempo.... Mil Gracias...
pongo el formulario donde capturo todo....
Código PHP:
<?php
function generaPaises()
{
include ("conexion.php");
conectar();
$consulta=mysql_query("SELECT id, opcion FROM lista_paises order by id asc");
desconectar();
// Voy imprimiendo el primer select compuesto por los paises
echo "<select name='paises' id='paises' onChange='cargaContenido(this.id)'>";
echo "<option value='0'>Elija su Centro de Trabajo</option>";
while($registro=mysql_fetch_row($consulta))
{
echo "<option value='".$registro[0]."'>".$registro[1]."</option>";
}
echo "</select>";
}
?>
<?
GLOBAL $date;
$date = date("Y-m-d");
?>
<html lang="es">
<head>
<title>Key_Req_Modify</title>
<noscript><style type="text/css">.hideIfJSdisabled{display:none;}</style></noscript>
</head>
<body>
<form method="post" action="../Key_Send.php" name="form1" onsubmit="return false;">
<?php echo str_repeat('<br>',3); ?><?php //echo str_repeat(' ',20); ?>
<table id="demo3_table" cellpadding="3" cellspacing="1" border="2" width="353" align="left">
<tr><td><img src="../images/logo_manto.jpg"></td></tr>
<tr bgcolor="#C8C8C8"><td align="middle"><font size="6" color="006666">
<strong>Formato para modificación de datos</strong></font></td></tr>
<tr><TD>Mes<?php echo str_repeat(' ',5); ?>
<SELECT name="mes">
<?php
include ("../conexion.php");
$registros=mysql_query("select var_mes from mes ",$conexion) or
die("Problemas en el select: ".mysql_error());
while ($reg=mysql_fetch_array($registros))
{
echo "<option value=\"$reg[var_mes]\">$reg[var_mes]</option>";
}
?>
</select>
<?php echo str_repeat(' ',15); ?>
Año<?php echo str_repeat(' ',5); ?>
<SELECT name="anio">
<?php
include ("../conexion.php");
$registros=mysql_query("select var_anio from anio ",$conexion) or
die("Problemas en el select: ".mysql_error());
while ($reg=mysql_fetch_array($registros))
{
echo "<option value=\"$reg[var_anio]\">$reg[var_anio]</option>";
}
?>
</select>
</td></tr>
<tr><td>
<div id="demo" style="width:600px;">
<div id="demoDer">
<select disabled="disabled" name="estados" id="estados">
<option value="0">Selecciona opción...</option>
</select>
</div>
<div id="demoIzq"><?php generaPaises(); ?></div>
</div>
</td></tr>
<tr bgcolor="#C8C8C8"><td align="middle"><font size="4" color="006666"><strong>
Escriba el correo a donde le llegará el código para modificación de Indicadores</strong></font>
</b><?php echo str_repeat(' ',10); ?>
<INPUT type=text name="correo" size="40" maxlength="40"></td></tr>
<tr><td>Explique su justificación
<font size="1" face="arial, helvetica, sans-serif"><?php echo str_repeat(' ',98); ?>
<input readonly type=text name=remLen size=3 maxlength=3 value="400"><strong> Caracteres permitidos</strong></font>
<br>
<textarea name=message wrap=physical cols=28 rows=4 style="width:660px;height:110px;background-color:#D0F18F;"
onKeyDown="textCounter(this.form.message,this.form.remLen,400);" onKeyUp="textCounter(this.form.message,this.form.remLen,400);"></textarea></td></tr>
<input type="hidden" name="fecha_solicitud" value="<?php echo $date ?>">
<tr><td align=center>
<?php
echo "<input type=\"button\" value=\"Enviar Información\" onclick=\"if(!valida_envia())return false;this.form.submit();\" ";
echo "class=\"botones hideIfJSdisabled\">";
echo "<noscript><input type=\"submit\" value=\"Enviar Información\" class=\"botones\"></noscript>";
?>
</table>
</form>
<br clear=left>
<br><br>
</html>
el archivo que lo recoge es este:
Código PHP:
mysql_query("insert into dco.Modificar_key (correo,nomb_cen,nomb_plan,mes,anio,IP,hostname,fecha_solicitud,message,autorizacion) values
('$_REQUEST[correo]','$_REQUEST[paises]','$_REQUEST[estados]','$_REQUEST[mes]','$_REQUEST[anio]',
'$_REQUEST[ip]','$_REQUEST[host]','$_REQUEST[fecha_solicitud]','$_REQUEST[message]','$_REQUEST[autorizacion]');",$conexion) or
die("<strong><span style=\"color:red;\">No se pudieron insertar los datos para elaborar la solicitud de Modificar Indicador</span></strong><br><br>".mysql_error());
echo '<strong><span style="color:green;">Solicitud recibida. <br><br>Se le enviará su clave vía correo en caso de ser aprovada.</span>.</strong><br><br>';
Y el famoso archivo que lo despliega como tabla es el siguiente:
Código PHP:
GLOBAL $result;
include("../../conexion.php");
$result = mysql_query("select correo,lista_paises.opcion pa1,lista_estados.opcion est1,mes,anio,fecha_solicitud,message,autorizacion from dco.Modificar_key
join lista_paises on dco.Modificar_key.nomb_cen=lista_paises.id
join lista_estados on dco.modificar_key.nomb_plan=lista_estados.id;");
// */
// $result = mysql_query("select correo from dco.Modificar_key");
$_space = " ";
if (!$result) {
die("Query to show fields from table failed");
}
// echo "<table class=\"art-article\" width=\"80%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<table class=\"art-article\" width=\"720px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tbody>";
echo "<tr>";
echo " <th width=\"80px\">Correo</th>";
echo " <th width=\"80px\">".$_space.$_space."Centro".$_space.$_space."</th>";
echo " <th width=\"80px\">".$_space.$_space."Planta".$_space.$_space."</th>";
echo " <th width=\"40px\">Mes</th>";
echo " <th width=\"40px\">Año</th>";
echo " <th width=\"80px\">fecha_solicitud</th>";
// echo " <th width=\"200px\">message</th>";
echo " <th width=\"200px\">message</th>";
echo " <th width=\"80px\">autorizacion</th>";
echo " <th width=\"40px\">Imagen</th>";
echo "</tr>";
while ($myrow = mysql_fetch_array($result))
{
echo "<TR>";
echo "<TD width=\"40px\" name=correo>".$myrow['correo']."</td><td width=\"80px\" name=centro\">".$myrow["pa1"]."</td>";//} //*
echo "<TD width=\"80px\" name=planta\">".$myrow["est1"]."</td><TD width=\"40px\" name=mes>".$myrow['mes']."</td>";
echo "<td width=\"40px\" name=anio>".$myrow["anio"]."</td><TD width=\"80px\" name=fecha_solicitud>".$myrow["fecha_solicitud"]."</td>";
echo "<TD width=\"200px\" name=message>".$myrow["message"]."</td><TD width=\"80px\" name=autorizacion>".$myrow["autorizacion"]."</td>";
if ($myrow['autorizacion'] == NULL)
{
echo "<TD width=\"40px\"><a href=\"Key_Generate.php?correo=".$myrow[correo]."¢ro=".$myrow[pa1]."&planta=".$myrow[est1]."&mes=".$myrow[mes]."&anio=".$myrow[anio]."&fecha_solicitud=".$myrow[fecha_solicitud]."\"><img src=\"images/X.png\" border=\"0\"></a></TD>";
}
else
{
// echo "<TD><A HREF=\"mailto:".$myrow['correo'].",[email protected][email protected]
// echo "<TD width=\"10%\"><A HREF=\"mailto:".$myrow['correo'].
echo "<TD width=\"40px\"><A HREF=\"mailto:".$myrow['correo'].
"&subject=Clave para permitir Modificacion de Indicadores
&body=Le%20 informo%20 que su solicitud para Modificacion de%20 Formularios%20 le%20 ha%20 sido%20 otorgada.
%0D%0A %0D%0A La%20 clave%20 que%20 se%20 le%20 ha%20 concedido%20 es:%0D%0A %0D%0A".$myrow['autorizacion'].
"%0D%0A %0D%0A Esta%20 clave%20 le%20 permite%20 modificar%20 el%20 Formulario%20 de%20
%0D%0A %0D%0A la%20 Planta%20 de:%20%20".$myrow['est1'].
"%0D%0A %0D%0A del%20 Centro%20 de:%20%20".$myrow['pa1'].
"%0D%0A %0D%0A La%20 fecha%20 de%20 solicitud%20 es%20 del%20 dia:%20%20".$myrow['fecha_solicitud'].
"%0D%0A %0D%0A Y%20 a%20 partir%20 de%20 esta%20 fecha%20 solo%20 cuenta%20 con%20 2%20 dias%20 para%20
%20la Modificacion%20 de%20 Indicadores\"><img src='images/Checkmark.png'></A></TD>";
}
} //*/
echo "</TR>";
echo "</TABLE>";
mysql_free_result($result);
Cómo ven....????
Qué es lo que anda mal que cuando le dan una dirección de correo electrónico o dentro del TEXT AREA le dan una cadena muy larga, MySQL no me respeta el ancho que le he definido en PHP...???![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)