I'm having some problems with my news script (www.lejendz.com to see it in action) - its supposed to allow you to open each title to view the full news, but it always opens the FIRST title.
I didn't write this javascript, I had a friend make it for me - so I'm completely lost... If anyone can help me with this problem, I'd be grateful
update: Figured out the javascript problem - each news post opens up - but theres now 10 news posts! Look on the site to see what i mean.... new code is below (Notice the new while loop)
<?
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
include("config.php");
?>
<html>
<head>
<title>Main</title>
</head>
<body bgcolor="#504533" text="#ffffff" link="#ffffff" vlink="#ffffff" alink="#ffffff">
<STYLE type=text/css>.content {
FONT-SIZE: 10px; COLOR: #ffffff; FONT-FAMILY: verdana
}
.content A:link {
FONT-SIZE: 10px; COLOR: #ffffff; FONT-FAMILY: verdana; TEXT-DECORATION: none
}
.content A:visited {
FONT-SIZE: 10px; COLOR: #ffffff; FONT-FAMILY: verdana; TEXT-DECORATION: none
}
.content A:active {
FONT-SIZE: 10px; COLOR: #ffffff; FONT-FAMILY: verdana; TEXT-DECORATION: none
}
.content A:hover {
FONT-SIZE: 10px; COLOR: yellow; FONT-FAMILY: verdana; TEXT-DECORATION: underline
}
.content2 {
FONT-SIZE: 10px; COLOR: #000000; FONT-FAMILY: verdana; TEXT-DECORATION: none
}
.content2 A:link {
FONT-SIZE: 10px; COLOR: #0004a4; FONT-FAMILY: verdana; TEXT-DECORATION: none
}
.content2 A:visited {
FONT-SIZE: 10px; COLOR: #0004a4; FONT-FAMILY: verdana; TEXT-DECORATION: none
}
.content2 A:active {
FONT-SIZE: 10px; COLOR: #0004a4; FONT-FAMILY: verdana; TEXT-DECORATION: none
}
.content2 A:hover {
FONT-SIZE: 10px; COLOR: #000000; FONT-FAMILY: verdana; TEXT-DECORATION: none
}
INPUT {
BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: #fdfdfd
}
TEXTAREA {
BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: #fdfdfd
}
.q {
COLOR: #0000cc; TEXT-DECORATION: none
}
</STYLE>
</HEAD>
<BR>
<TABLE class=content2 cellSpacing=0 cellPadding=3 width="100%" border=0>
<TBODY>
<TR>
<TD width="100%" colSpan=2 height=23> </TD>
</TR>
<TR>
<TD width="100%" colSpan=2 height=23><BR>
<B><font size="1" face="verdana">News</font></B><BR></TD></TR>
<TR>
<SCRIPT>
function NeHandler(nyhet)
{
bild = "bild_" + nyhet;
if(document.getElementById(nyhet).style.display=="none")
{
document.getElementById(nyhet).style.display='' ;
document.getElementById(bild).src='images/pilned.gif' ;
}
else
{
document.getElementById(nyhet).style.display="none";
document.getElementById(bild).src='images/pil.gif' ;
}
}
</SCRIPT>
<SCRIPT language=JavaScript>
function smile(face)
{
var cache = document.form.body.value;
document.form.body.value = cache + " " + face;
document.form.body.focus();
}
</SCRIPT>
<?php
$a = new database();
$a->connect();
$o = 1;
while ($o <= 10) {
//date("m/j/y", $row['date'])
//date("H:i", $row['date'])
$gettime = mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT 0, 10");
// .$row['title']., .date("m/j/y", $row['date'])., .date("H:i", $row['date'])., .$row['user']., .$row['news'].
while ($row = mysql_fetch_array($gettime)){
?>
<TD style="CURSOR: hand" onclick="javascript:NeHandler('nyhet_<? print $o; ?>')" width="100%" bgColor=#cfd0cf colSpan=2>
<font size="1" face="verdana">
<?
print "".$row['title']."";
?>
</font></TD></TR>
<TR>
<TD id=nyhet_<? print $o; ?> style="DISPLAY: none" bgColor=#f0f0e0>
<BLOCKQUOTE><font size="1" face="verdana">
<?
print "".$row['news']."";
?>
</font><BR>
</BLOCKQUOTE>
<DIV align=right>
<?
print "Posted by ".$row['user']." on ".date("m/j/y", $row['date'])." at ".date("H:i", $row['date'])."";
?>
</font></DIV></TD></TR>
<?
$o++;
}
}
?>
<TR>
</TR></TBODY></TABLE>
</body>
</html>