Howdy folks… the code for my page is below and the website that it is currently viewable on is : [url]http://scott.loddonexplorers.co.uk/contacts.php
1) The only data i should see is the list of names and there email address. I currently get the expanded view…
2) When i click a button which should be visable to the left of the name, it should show all data, but the button currently dosent show, neither does it work when i click it… but all the data is viewable.. any ideas?
Fet
[code=php]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Leaders</title>
<meta http-equiv=”content-type” content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”css/phpdisplay.css” />
<script type=”text/javascript”>
function showDetails(memberID,button){
var element = document.getElementById(memberID);
if(element.style.display != ‘block’){
element.style.display = ‘block’;
button.style.backgroundImage = ‘url(“images/minus.gif”)’;
}else{
element.style.display = ‘none’;
button.style.backgroundImage = ‘url(“images/plus.gif”)’;
}
}
</script>
</head>
<body>
<div>
<?php
$connx = mysql_connect(“localhost”, “root”, “admin”) or
die(“ERROR: Unable to establish database connection”);
$dbconnx = mysql_select_db(‘Main’) or
die(“ERROR: Unable to establish database connection”);
?>
<p class=”title”>Leader Team</p>
<blockquote>
<?php
$result = mysql_query(‘SELECT * FROM `Contacts` GROUP BY `ID`’) or
die(‘<p>Error performing query: ‘ . mysql_error() . ‘</p>’);
echo ‘<div id=”alldetails”>’;
$i = 0;
while($row = mysql_fetch_row($result))
{
echo <<<END
<p><input type=”image” class=”button” id=”button$i” value=” ” onclick=”showDetails(‘person$i’,this);return true;”> {$row[2]} {$row[3]} <a href=”mailto:{$row[9]}”>{$row[9]}</a></p>
<p id=”person$i” class=”details”>
<table width=”800″ border=”0″>
<tr>
<td><b>Name:</b></td>
<td>{$row[2]} {$row[3]}<br></td>
</tr>
<tr>
<td><b>Address:</b></td>
<td>{$row[4]}<br></td>
</tr>
<tr>
<td><b>Town:</b></td>
<td>{$row[5]}<br></td>
</tr>
<tr>
<td><b>Postcode:</b></td>
<td>{$row[6]}<br></td>
</tr>
<tr>
<td><b>Home Phone:</b></td>
<td>{$row[7]}<br></td>
</tr>
<tr>
<td><b>Mobile:</b></td>
<td>{$row[8]}<br></td>
</tr>
<tr>
<td><b>Email:</b></td>
<td>{$row[9]}<br></td>
</tr>
</table>
END;
$i++;
}
?></div>
</blockquote>
</div>
</body>
</html>