tengo el siguiente codigo:
Código PHP:
<?
if(!isset($_GET['id']))
{
$self = $_SERVER['PHP_SELF'];
$query = "SELECT id, title FROM news2 ORDER BY id";
$result = mysql_query($query) or die('Error : ' . mysql_error());
// create the article list
$content = '<ol>';
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
list($id, $title) = $row;
$content .= "<li><a href=\"$self?id=$id\">$title</a></li>\r\n";
}
$content .= '</ol>';
$title= 'OFICINAS';
} else {
// get the article info from database
$query = "SELECT title, nombre, content FROM news2 WHERE id=".$_GET['id'];
$result = mysql_query($query) or die('Error : ' . mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$title = $row['title'];
$nombre = $row['nombre'];
$content = $row['content'];
include 'library/closedb.php';
}
?>
<html>
<head>
<title>
<?php echo $title;?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
color: #006699;
font-weight: bold;
}
.main {
padding: 10px;
border: 1px solid #006699;
position: relative;
width: 580px;
margin-top: 20px;
margin-bottom: 20px;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
</head>
<body>
<h1 align="center"><? echo $title?></h1>
<?php
echo "<br>";
echo $title;
echo "<br>";
if ($nombre<>"")
{
echo $nombre;
}
echo "<br>";
echo $content;
echo "</td>";
echo "</tr>";
echo "</table>";
?>
1.- Link1
2.- Link2
3.- Link3
Y asi......
si yo hago click en cualquiera de esos links, me muestra el resultado, pero desaparece la lista ordenada
Ahora, la idea q tengo es mostrar la lista ordenada en un lado, y si yo hago click en cualquiera de los links, me muestre el resultado al lado, sin q desaparezca la lista ordenada, algo asi:
Contenido Link1
blablablablablablabla Link2
blablablablablablabla
blablablablablabla
blablablablablablabla
blablablablablablablabla
Si hago click en el link dos, me muestre el resultado ahi donde dice contenido
y asi......
como lo puedo hacer???
Saludos