Buenas gente, antes que nada quiero agradecer a todos los que se tomen un minuto o varios para tratar de darme una mano.
Quise crear una funcion que haciendo click en una imagen oculte o muestre un div con x informacion, pero por alguna razon no anda y no logro encontrar el error.
Si alguien me puede dar una mano lo agradeceria.
copio el codigo
Código:
<?php
if (isset($_GET['d']))
{
//defino d como lo que ingresa por GET
$d= $_GET['d'];
//Query especificando que el rubro va a depender de lo que entra por d
$query=mysql_query("SELECT * FROM ingresedatos WHERE rubro= '".$d."' ORDER BY id DESC" );
//muestro el query
function start_section ($id, $title)
{ ?>
<table cellspacing="0" cellpadding="0">
<tr><td width="30" valign="top">
<a href="javascript: void twist ('<?php echo ($id); ?>');"><img src="up.png" alt="-" ></a>
</td><td width="90%">
<p class="titulos"><?php echo ($title); ?></p>
<div id="<?php echo ($id); ?>" class="spin-content">
<?php } function end_section () { ?>
</div></td></tr></table>
<?php } function spinner_header () { ?>
<script language="javascript">
function twist (sid)
{
imgobj= document.getElementById ("img_"+sid);
divobj= document.getElementById (sid);
if (imgobj.src.match ("up.png"))
{
imgobj.src ="down.png"
divobj.style.position= "relative";
divobj.style.visibility = "visible";
}
else
{
imgobj.src="up.png";
divobj.style.visibility = "hidden";
divobj.style.position = "absolute";
}
}
</script>
<?php } while ($row=mysql_fetch_array($query)) {?>
<html>
<head><?php spinner_header();?></head>
<body>
<?php
$titulo = $row['nombre'];
start_section('one', "$titulo"); ?>
<!--Texto dentro del spinner-->
<p class="Estilo7">
<br /> Dirección: <?= $row['direccion']; ?>
<br /> Web: <?= $row['web']; ?>
<br /> <?= $row['descripcion']; ?>
</p>
<?php end_section(); } } ?>
</body></html>
pd mis disculpas si es muy feo pero estoy aprendiendo