Foros del Web » Programando para Internet » PHP »

Codigo html y php en campo mysql

Estas en el tema de Codigo html y php en campo mysql en el foro de PHP en Foros del Web. Hola a todos, estoy tratando de imprimir un campo text de mysql donde tengo guardado todo una página php. y se me corta. Código guardado ...
  #1 (permalink)  
Antiguo 25/02/2011, 12:29
 
Fecha de Ingreso: agosto-2002
Ubicación: Capital Federal
Mensajes: 98
Antigüedad: 21 años, 8 meses
Puntos: 1
Codigo html y php en campo mysql

Hola a todos, estoy tratando de imprimir un campo text de mysql donde tengo guardado todo una página php. y se me corta.

Código guardado en mysql:
<?php require_once('Connections/cnx.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;
}
}
$hoy = date("Y-m-d");

mysql_select_db($database_pjn, $pjn);
$query_rsLicitaciones = "SELECT * FROM `info_publicada` WHERE `Nodo` = '36' AND `RubroID` = '75' AND ('".$hoy."' >= Vig_Desde and '".$hoy."' < Vig_Hasta) Order By Orden Desc";
$rsLicitaciones = mysql_query($query_rsLicitaciones, $pjn) or die(mysql_error());
$row_rsLicitaciones = mysql_fetch_assoc($rsLicitaciones);
$totalRows_rsLicitaciones = mysql_num_rows($rsLicitaciones);
?>
<?php
function smrFormatStr($var1) {
$cadena = $var1;
$cadena = str_replace( chr(13), "", $cadena );
$cadena = str_replace( chr(10) & chr(10), "</P><P>", $cadena);
$cadena = str_replace( chr(10), "<BR><BR>", $cadena );
return($cadena) ;
}
function tatoFecha($var1) {
list($year, $month, $day) = split('[/.-]', $var1);
$fecha = $day."-".$month."-".$year;
return($fecha);
}
?>
<!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=iso-8859-1" />
<title>INTRANET - Poder Judicial de la Naci&oacute;n</title>
<link href="estilos.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="includes/tooltip/jquery.min.js"></script>
<script type="text/javascript" src="includes/tooltip/jqueryTooltip.js"></script>
<script src="includes/Scripts/swfobject_modified.js" type="text/javascript"></script>
<link href="includes/grilla.css" rel="stylesheet" type="text/css" />
<!--PopUp PDF-->
<script type="text/javascript" src="includes/lyteboxPDF/lytebox.js"></script>
<link rel="stylesheet" href="includes/lyteboxPDF/lytebox.css" type="text/css" media="screen" />
<!--Fin PopUp PDF-->

</head>
<body>
<div class="contenedor">
<!--
<div class="imagen-Left"><img src="imagenes/cm-logo.png" width="274" height="75" alt="Logo CM" /></div>
<div class="imagen-Right"><img src="imagenes/intranet.gif" width="166" height="75" alt="INTRANET" /></div>
-->
<?php require("includes/copete.php"); ?>
<div class="line">&nbsp;</div>
<?php include("includes/dropdown.php");?>
<?php include("includes/iconos.php");?>
<div class="bodyContenido">
<div class="contieneView">
<div class="tituloLink">Licitaciones</div>
<div class="col1">TIPO</div>
<div class="col2">NUMERO</div>
<div class="col3">DESCRIPCION</div>
<div class="col4">VER</div>
<?php do { ?>
<div class="colTipo" onmouseover="this.style.backgroundColor='#FC9';" onmouseout="this.style.backgroundColor='#FFC';"><? php echo $row_rsLicitaciones['Acto_Tipo']; ?></div>
<div class="colNro" onmouseover="this.style.backgroundColor='#FC9';" onmouseout="this.style.backgroundColor='#FFC';"><? php echo $row_rsLicitaciones['Acto_Nro']; ?>/<?php echo $row_rsLicitaciones['Acto_Ano']; ?></div>
<div class="colDesc" onmouseover="this.style.backgroundColor='#FC9';" onmouseout="this.style.backgroundColor='#FFC';" title="<?php echo $row_rsLicitaciones['Texto'];?>"><?php echo substr ($row_rsLicitaciones['Texto'], 0, 85)."...";?></div>
<div class="colVer" onmouseover="this.style.backgroundColor='#FC9';" onmouseout="this.style.backgroundColor='#FFC';"><a href="http://www.pjn.gov.ar/02_Central/ViewDoc.Asp?doc=<?php echo $row_rsLicitaciones['Codigo']; ?>&CI=intranet" rel="lyteframe" rev="width: 700px; height: 500px;">VER</a></div>
<?php } while ($row_rsLicitaciones = mysql_fetch_assoc($rsLicitaciones)); ?>
</div>
<?php if ($row_rsContenido['nuevo']==1){ ?>
<?php }?>
<div class="infografia"></div>
</div>
<div class="body-Acceso"><?php include("includes/accesos.php"); ?></div>
<div class="line">&nbsp;</div>
<!--Divide Body - MULTIMEDIA-->
<!--Fin Divide Body - MULTIMEDIA-->
<?php include("includes/footer/footer.php"); ?>
<div class="footer">Sitio optimizado para Internet Explorer - Firefox - Resolución 1024 - 768</div>
</div>
</body>
</html>
<?php
mysql_free_result($rsLicitaciones);
?>

y se corta aca:
= Vig_Desde and '".$hoy."' < Vig_Hasta) Order By Orden Desc"; $rsLicitaciones = mysql_query($query_rsLicitaciones, $pjn) or die(mysql_error()); $row_rsLicitaciones = mysql_fetch_assoc($rsLicitaciones); $totalRows_rsLicitaciones = mysql_num_rows($rsLicitaciones); ?> ", $cadena); $cadena = str_replace( chr(10), "

", $cadena ); return($cadena) ; } function tatoFecha($var1) { list($year, $month, $day) = split('[/.-]', $var1); $fecha = $day."-".$month."-".$year; return($fecha); } ?>

Alguien podría decirme que estoy haciendo mal. Muchas Gracias
  #2 (permalink)  
Antiguo 25/02/2011, 12:37
 
Fecha de Ingreso: diciembre-2010
Mensajes: 788
Antigüedad: 13 años, 4 meses
Puntos: 51
Respuesta: Codigo html y php en campo mysql

Qué querés decir con que se corta? Te da algún error? Si se corta y no te muestra error, es porque están deshabilitados. Prueba poner esto al principio y ve que error te dá:

Código PHP:
Ver original 
  #3 (permalink)  
Antiguo 25/02/2011, 12:47
 
Fecha de Ingreso: julio-2010
Mensajes: 275
Antigüedad: 13 años, 9 meses
Puntos: 21
Respuesta: Codigo html y php en campo mysql

Si lees
<url=http://php.net/manual/en/ref.session.php> el manual de sessiones en PHP></url>??
  #4 (permalink)  
Antiguo 25/02/2011, 16:15
Avatar de jheckson  
Fecha de Ingreso: febrero-2011
Ubicación: $VE->Aragua['Maracay']
Mensajes: 109
Antigüedad: 13 años, 2 meses
Puntos: 8
Respuesta: Codigo html y php en campo mysql

no sera que tu variable donde guardas la pagina completa no tiene la longitud suficiente para poder guardar toda la informacion que quieres almacenar en ella...

ese codigo que quieres guardar es de casi 5000 caracteres... no se cuanto sea la cantidad maxima que permita un un tipo text... pero intenta a ver con un longtext si te funciona.
  #5 (permalink)  
Antiguo 25/02/2011, 17:25
Avatar de Ronruby  
Fecha de Ingreso: julio-2008
Ubicación: 18°30'N, 69°59'W
Mensajes: 4.879
Antigüedad: 15 años, 9 meses
Puntos: 416
Respuesta: Codigo html y php en campo mysql

Un campo tipo TEXT permite hasta 65,535bytes, eso quiere decir que no deberia haber ningun problema al mostrar el codigo. Muestranos como lo imprimes.
  #6 (permalink)  
Antiguo 28/02/2011, 04:16
 
Fecha de Ingreso: agosto-2002
Ubicación: Capital Federal
Mensajes: 98
Antigüedad: 21 años, 8 meses
Puntos: 1
Respuesta: Codigo html y php en campo mysql

Perdón, cuando dije que se corta en realidad era que imprimia el codigo, adjunto imagen y el campo es longtext. y lo imprimo <?php echo $row_rsArmador['contenido'];?> Desde ya muchas gracias

Última edición por Tato; 28/02/2011 a las 05:55

Etiquetas: html, mysql, campos
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 07:46.