Hi
I know that I'm using html for the link, but I need to pass the php variable in order to link the file. Can help me in the code? I need to link with second file and display it it the iframe name=eventsDisplay.
thanks
nma
This is the codes in first file
[PHP]
<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#FFFF00" onMouseOver="this.style.background ='#943429'"
onMouseOut="this.style.background='#FFFF00'" onclick="parent.playClip(<?php echo $timeline->eventID?>, <?php echo $shotStartTime?>, <?php echo $shotStopTime?>);parent.notesForm.eventID.value=<? php echo $timeline->eventID?>;parent.resetNotes();"><a href="MB2eventlist.php"?movieID=<?php echo $movie->movieID;?>&
target="eventsDisplay">bar</a></td>
[/PHP]
This is the codes in second file (MB2eventlist.php) that I need to link.
[PHP]
<?php
session_start();
// Make sure users are logged in.
if(!isset($_SESSION['user'])) {
header('Location: /..');
die();
}
function sec2hms ($sec, $padHours = false)
{
.....
return $hms;
}
?>
<?php
include_once('../ez_sql.php');
$movieID = $_GET['movieID'];
$pageName = $_SERVER['PHP_SELF'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Browse-Search</title>
<link rel="stylesheet" href="...css" type="text/css" title="Default" media="screen"/>
</head>
<body bgcolor="#726257" background="iframe-background.jpg" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" style="width:260px;overflow:hidden;">
<table width="270" border="0" cellspacing="0" cellpadding="0">
<?php
function insertEventTableRow($movieID, $eventID, $keyFrame, $startTime, $stopTime, $eventInformation) {
?>
<tr bgcolor="#726257" onMouseOver="this.bgColor='#534741';" onMouseOut="this.bgColor='#726257';" style="cursor: pointer;">
<td width="65" valign="top" width="65" height="44" border="1" vspace="2">
<img src="<?php echo $keyFrame;?>"
onclick="parent.playClip(<?php echo $eventID?>, <?php echo $startTime;?>, <?php echo $stopTime;?>);parent.notesForm.eventID.value=<?php echo $eventID?>;parent.resetNotes();">
</td>
<td width="195" class="eventEntryText" onclick="parent.playClip(<?php echo $eventID?>, <?php echo $startTime;?>, <?php echo $stopTime;?>);parent.notesForm.eventID.value=<?php echo $eventID?>;parent.resetNotes();">
<?php echo $eventInformation?>
</td>
</tr>
<tr>
<td colspan="2" height="5">
<img src="iframe-borderline.jpg" width="230" height="5"/>
</td>
</tr>
<?php
}
$events = (isset($_REQUEST['events']))?$_REQUEST['events']:"All";
switch($events) {
case "All":
break;
case "Dialogue":
case "Montage":
case "Exciting":
$db->query("INSERT INTO LogsTable (page, action, userID, type, date) VALUES ('MB2eventlist', '$events categories', " . $_SESSION['user']->userID . ", '', getDate())");
$allEvents = $db->get_results("SELECT * FROM EventsShotsStartAndStopFrames where movieID='$movieID' and eventCategory = '$events' order by eventNo");
foreach($allEvents as $event)
{
$shotStartTime = $event->shotStartFrame/29.97;
if(is_int($event->shotStartFrame)) {
$shotStopTime = $event->shotStopFrame/29.97;
}
else {
$shotStopTime = 0;
}
$numberOfShotsInEvent = $event->endShot - $event->startShot;
$eventInformation = "<b>$events " . $event->eventNo . "</b><br />($numberOfShotsInEvent shots)<br />";
$eventInformation .= '<em style="font-size:smaller;">' . sec2hms($shotStartTime) . " - " . sec2hms($shotStopTime).'</em>';
insertEventTableRow($_GET['movieID'], $event->eventID, $event->imgSelectedKeyfrm, $shotStartTime, $shotStopTime, $eventInformation);
}
break;
default:
die("Invalid Event!");
break;
}
?>
</table>
</body>
</html>
[/PHP]
The view source in the first file is:
<td width="30" height="17" bgcolor="#FFFF00" onMouseOver="this.style.background ='#943429'"
onMouseOut="this.style.background='#FFFF00'" onclick="parent.playClip(1, 45.011678345, 265.999332666);parent.notesForm.eventID.value=1;pa rent.resetNotes();"><a href="MB2eventlist.php"?movieID=1&
target="eventsDisplay">bar</a></td>
The error message in the iframe display is:
Notice: Undefined index: movieID in C:\..\MB2eventlist.php on line 22
SQL/DB Error -- [Incorrect syntax near '='.]
Another questions is how to onclick on the <td> without click at the word 'bar'? If I don't want to use <img> is it possible? I just want to click on the <td> only. Maybe this question suitable for html/css forum. Sorry