Código PHP:
<?php
session_start();
include("config.php");
$link=conectar_BD();
// Buscamos los datos, segun su id (datos: precios, marca. modelo, etc.)
$qry=mysql_query("select * from $name_tb[productos] where id='".$id."'");
$row=mysql_fetch_array($qry);
?>
<!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>
<title>Caracteristicas del producto</title>
<style type="text/css">
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
background-color: #FFFFFF;
margin-left: 5px;
margin-right: 5px;
}
#ContTabul {
border-left: 1px solid #CCC;
border-right: 1px solid #CCC;
border-bottom: 1px solid #CCC;
padding: 10px 5px 6px 5px;
}
ul#tabnav {
list-style-type: none;
margin: 0;
padding-left: 40px;
padding-bottom: 24px;
border-bottom: 1px solid #CCC;
font: 11px verdana, arial, sans-serif;
}
ul#tabnav li {
float: left;
height: 21px;
background-color: #E4E4E4;
color: #666;
margin: 2px 10px 0 2px;
border: 1px solid #CCC;
}
ul#tabnav a:link, ul#tabnav a:visited {
display: block;
color: #666;
text-decoration: none;
padding: 4px;
}
ul#tabnav a:hover {
background-color: #CCC;
color: #666;
}
#tabnav .activo {
border-bottom: 1px solid #fff;
color: #000000;
background-color: #FFFFFF;
}
#tabnav .inactivo {}
</style>
<script language = "javascript">
function ObtenerDatos(datos,divID) {
if(peticion) {
var obj = document.getElementById(divID);
peticion.open("GET", datos);
peticion.onreadystatechange = function() {
if (peticion.readyState == 4) {
obj.innerHTML = peticion.responseText;
}
}
peticion.send(null);
}
}
function CambiarEstilo(id) {
var elementosMenu = getElementsByClassName(document, "li", "activo");
for (k = 0; k< elementosMenu.length; k++) {
elementosMenu[k].className = "inactivo";
}
var identity=document.getElementById(id);
identity.className="activo";
}
function getElementsByClassName(oElm, strTagName, strClassName){
var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
strClassName = strClassName.replace(/\-/g, "\\-");
var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
var oElement;
for(var i=0; i<arrElements.length; i++){
oElement = arrElements[i];
if(oRegExp.test(oElement.className)){
arrReturnElements.push(oElement);
}
}
return (arrReturnElements)
}
</script>
<style type="text/css">
a {color:#858585;text-decoration:none;font-family: Tahoma;font-size: 10px}
td {color:#858585;text-decoration:none;font-family: Tahoma;font-size: 10px}
</style>
</head>
<body>
<table width="750">
<tr>
<td>
<div align="center"><img src="../imagenes/encabezado1.gif" width="771" height="112" /></div>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<table align="center" width="550"><tr><td align="right"><a href="#" onClick="cerrar()">Cerrar ventana aqui</a></td></tr></table>
<ul id="tabnav">
<li class="activo" id="bt1"><a href="javascript:ObtenerDatos('1.php','ContTabul');CambiarEstilo('bt1');">General</a></li>
<li class="inactivo" id="bt2"><a href="javascript:ObtenerDatos('2.php','ContTabul');CambiarEstilo('bt2');">+ Fotos</a></li>
<li class="inactivo" id="bt3"><a href="javascript:ObtenerDatos('3.php','ContTabul');CambiarEstilo('bt3');">Consulta</a></li>
</ul>
<div id="ContTabul">
<table width="700">
<tr>
<td width="350" rowspan="2">
<img src="../../imagenes/filmagrande.jpg">
</td>
<td>
<table width="100" align="center">
<tr><td colspan="2"><strong>Precio Contado</strong></td></tr>
<tr><td colspan="2">$ <?php echo $row['contado_p'];?></td></tr>
<tr><td colspan="2"><strong>Financiacion</strong></td></tr>
<tr><td colspan="2">6 x $ <?php echo $row['p_6'];?></td></tr>
<tr><td colspan="2">12 x $ <?php echo $row['p_12'];?></td></tr>
<tr><td colspan="2">18 x $ <?php echo $row['p_18'];?></td></tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="350">
<tr><td><strong>Caracteristicas</strong></td></tr>
<tr><td>Marca: <?php echo $row['marca'];?></td></tr>
<tr>
<td>Articulo: <?php echo $row['articulo'];?></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
Archivo que no muestra los datos de php
Código PHP:
<style type="text/css">
a {color:#858585;text-decoration:none;font-family: Tahoma;font-size: 10px}
td {color:#858585;text-decoration:none;font-family: Tahoma;font-size: 10px}
</style>
<table width="700">
<tr>
<td width="350" rowspan="2">
<img src="../../imagenes/filmagrande.jpg">
</td>
<td>
<table width="100" align="center">
<tr><td colspan="2"><strong>Precio Contado</strong></td></tr>
<tr><td colspan="2">$ <?php echo $row['contado_p'];?></td></tr>
<tr><td colspan="2"><strong>Financiacion</strong></td></tr>
<tr><td colspan="2">6 x $ <?php echo $row['p_6'];?></td></tr>
<tr><td colspan="2">12 x $ <?php echo $row['p_12'];?></td></tr>
<tr><td colspan="2">18 x $ <?php echo $row['p_18'];?></td></tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="350">
<tr><td><strong>Caracteristicas</strong></td></tr>
<tr><td>Marca: <?php echo $row['marca'];?></td></tr>
<tr>
<td>Articulo: <?php echo $row['articulo'];?></td>
</tr>
</table>
</td>
</tr>
</table>