Hello everyone! Guys I really need your help. I'm still a noob and a student. So I made a table for electoral officials and also I made a link where user can see the information of the certain candidates in mouseover box. But I'm still trying to figure out how to display the information of the candidates in mouseover box using php. Any help would be greatly appreciated.
Here is my code anyway:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>TITLE</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<script src="sorttable.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
$(function() {
var moveLeft = 20;
var moveDown = 10;
$('a#trigger').hover(function(e) {
$('div#pop-up').show();
//.css('top', e.pageY + moveDown)
//.css('left', e.pageX + moveLeft)
//.appendTo('body');
}, function() {
$('div#pop-up').hide();
});
$('a#trigger').mousemove(function(e) {
$("div#pop-up").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
});
});
</script>
</head>
<body>
<div id="page">
<?php
include('voting_connect.php');
{
$result = mysql_query("SELECT * FROM candidates WHERE c_position='Secretary'")
or die(mysql_error());
echo "<center><table id='tables' class='sortable'>";
echo "<tr><th>Secretary:</th></tr>";
while($row = mysql_fetch_array( $result )) {
echo "<tr>";
$row['c_ID'];
echo '<td>' . $row['c_fname'] . ' ' . $row['c_lname'] .'</td>';
echo '<td><a href="?ID=' . $row['c_ID'] .'" id="trigger">View Profile</a></td>';
echo"</tr>";
}
echo"</table></center>";
}
?>
<div id="pop-up">
<h3>Profile:</h3>
<font color="black" size="3">
<?php
include('voting_connect.php');
{
$result = mysql_query("SELECT * FROM candidates WHERE c_position='Secretary'")
or die(mysql_error());
$row = mysql_fetch_array( $result );
echo 'Name: ' . $row['c_fname']. ' ' .$row['c_lname']. '' ;
}
?>
</font>
</div>
</div>
</div>
<!-- end content -->
<div style="clear: both;"> </div>
</div>
<!-- end page -->
</body>
</html>