algo asi
Este curso tiene un costo de $300.000.- (trescientos mil pesos) por participante. El código Sence es 12.37.7824-62. También está disponible como curso cerrado.
que puedo hacer para solucionar este problema

| |||
| buenas tardes al rescatar valores con acento y ñ me tira caracteres raros algo asi Este curso tiene un costo de $300.000.- (trescientos mil pesos) por participante. El código Sence es 12.37.7824-62. También está disponible como curso cerrado. que puedo hacer para solucionar este problema ![]()
__________________ Pablo Baez |
| |||
| Respuesta: caracteres raros Pon este código en el head sustituyendo a la que tienes <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <? utf8_decode($cadena); ?> No falla nunca. Un saludo. |
| |||
| lo copie, lo coloque en la cabecera y no funciona ademas tengo la coneion ala base de datos
Código:
se supone que asi no tendria problemas pero no funciona <?php
$config = array(
"dbserver" => "localhost",
"dbname" => "casa",
"dbuser" => "root",
"dbpassword"=> "1234"
);
$conector = @mysql_connect($config[dbserver],$config[dbuser],$config[dbpassword]);/*Abriendo conexion base de datos*/
$ping=@mysql_ping($conector);
if($ping){
@mysql_select_db($config[dbname],$conector);/*Seleccionando base de datos*/
mysql_query("SET character_set_results='utf8'",$conector);
}
else{
print mysql_error();
print"<center><h3>Error de conexión</h3></center>";
exit;
}
?>
__________________ Pablo Baez |
| |||
| Respuesta: caracteres raros Quizá no me expliqué bien. Debes ponerlo tal cual te lo he enviado dentro del <head> en el html de tu web sustituyendo el código que tienes como juego de caracteres en las etiquetas "meta". Funciona seguro y siempre. Yo he hecho más de 300 web con base de datos y jamás me ha dado fallos. Ya me dirás si te funciona, seguro que sí. |
| |||
| holaa aqui esta mi codigo completo yy no me funciona
Código:
<?php
include("data/dbapertura.php");
$CodigoPrograma=$_GET["CodigoPrograma"];
$sql= "Select * from programas where pro_publicar = 'S' and pro_codigo = '$CodigoPrograma'";
$query = mysql_query($sql,$conector);
If (mysql_num_rows($query)>0)
{
$Titulo = $row["pro_titulo"];
$Codigo = $row["pro_codigo"];
$Detalle= $row["pro_detalle"];
$Archivo= $row["pro_imagen"];
}
mysql_free_result($query);
?>
<html>
<style type="text/css">
BODY {
scrollbar-face-color: #000066;
scrollbar-shadow-color: #ffffff;
scrollbar-highlight-color: #000066;
scrollbar-3dlight-color: #ffffff;
scrollbar-darkshadow-color: #000066;
scrollbar-track-color: #000066;
scrollbar-arrow-color: #ffffff;
}
//-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<link href="css/vinculos.css" rel="stylesheet" type="text/css">
<link href="css/estilos.css" rel="stylesheet" type="text/css">
<head>
<title>Documento sin título</title>
<!-- aqui esta el codigo -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<? utf8_decode($cadena); ?>
<link href="css/backg01.css" rel="stylesheet" type="text/css">
<link href="css/textos.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#000066" leftmargin="0" topmargin="15" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="190" valign="top">
<?php
include("IncludeMenuCapacitacion.php");
?>
</td>
<td align="center" valign="top">
<table width="680" border="0" cellpadding="3" cellspacing="0" class="contblanco">
<tr>
<td width="586" height="42"><img src="images/titulos/capacitacion.jpg" width="460" height="32"></td>
</tr>
<tr>
<td valign="top" class="titblanco1"> </td>
</tr>
<tr>
<td valign="top" class="titblanco1"><?=$Titulo?></td>
</tr>
<tr>
<td align="right" valign="top">
<?php if (Trim($Archivo) <> "") {?>
<a href="#" class="vermas" onClick="MM_openBrWindow('ImagenCurso.php?Imagen=<?=$Archivo?>&NombrePrograma=<?=$Titulo?>','','scrollbars=yes,width=885,height=500')">ver calendario completo</a>
<?php }?>
</td>
</tr>
<tr>
<td valign="top"><strong>PRESENTACIÓN </strong> <p><?=str_replace(chr(13),"<br>",$Detalle)?></p></td>
</tr>
<tr>
<td valign="top"> </td>
</tr>
<tr>
<td valign="top"><strong>
<?php if ($_REQUEST["CodigoPrograma"] == 1) { print("CURSOS ÁREA DE AUTOMATIZACION"); } else{ print("CURSOS ÁREA DE ACCIONAMIENTO");}?>
</strong></td>
</tr>
<tr>
<td valign="top"> </td>
</tr>
<?php
$sql = "Select * from cursos where cur_publicar = 'S' and pro_codigo = ".$_REQUEST["CodigoPrograma"]." order by cur_orden";
$query = mysql_query($sql,$conector);
while ($row = mysql_fetch_array($query)) {
$TituloCurso = $row["cur_titulo"];
$CodigoCurso = $row["cur_codigo"];
?>
<tr>
<td valign="top"><a href="DetalleCurso.php?CodigoCurso=<?=$CodigoCurso?>&NombrePrograma=<?=$Titulo?>&Archivo=<?=$Archivo?>" target="contenido" class="botonblanco2"><?=$TituloCurso?></a></td>
</tr>
<?php
}
mysql_free_result($query);
?>
</table>
</td>
</tr>
</table>
</body>
</html>
<?php
include("data/dbcierre.php");
?>
![]()
__________________ Pablo Baez |
| Etiquetas: |
Este tema le ha gustado a 1 personas