473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

corresponding link to another file to be display in iframe

93
Hi Again,

Can someone give ideas on how should I do this task?
I've made a simple timeline using <td> and when I mouseover the cell I want it to link to another list of something and it will corresponding to it.
Eg..in my timeline say
cellwidth1->keyFrame1
cellwidth2->keyFrame2
cellwidth3->keyFrame3
....

keyFrame1,2,3..is from another file.

[PHP]
foreach($allEvents as $timeline)
{
.....
.....
.....

<td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#4A8A00" onMouseOver="this.style.background ='#9CCB52'" onMouseOut="this.style.background='#4A8A00'"></td>
...
....
[/PHP]

and this is the second file to be link

[PHP]
....
....
<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;?>)"></td>
...
...

[/PHP]

the display is in the iframe in the first file. The iframe name=eventsDisplay. Should I use onClick?

Thanks

nma
Jan 30 '08 #1
2 1599
ak1dnar
1,584 Expert 1GB
I know that you are printing the HTMLs from php, but there is nothing to do here with Php. Please do like this, get the php generated output (HTML source) and ask this question in the HTML/CSS Forum. There are Experts for this. Thanks.
Jan 31 '08 #2
nma
93
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
Jan 31 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: paul dallaire | last post by:
HI! I want to execute a link witch is in JavaScript, How do we execute this in asp server side if possible? Basically I don't want anyone to see this link in the code view. this is the link...
1
by: Robert de Ridder | last post by:
I use an asp page to display pages, where the dynamic content is in an iframe. To calculate the height of the iframe I use the calcheight function. However when trying to do this with external...
6
by: jeet_sen | last post by:
Hi, I have generated a table and have attached a pop up to display at onmouseover event of each cell. For each cell the pop up will display cell specific detailed data. I have generated the pop...
7
by: SHC | last post by:
I'm in need of some javascript to load two pages into two seperate iframes which are on two seperate and different pages. Rather complicated I know (and easier done in one frameset), but caused...
14
by: eddy.pagotto | last post by:
Hi, I'm trying to display external link into a DIV (http:// www.google.com/, for example). I don't want to use IFRAME, because I already tried it and I'm not satisfied about the results. How can...
3
XtinaS
by: XtinaS | last post by:
I'm trying to write a script for Greasemonkey that will, in LiveJournal, replace a placeholdered embedded YouTube thing with a link to the video. In LiveJournal, you can set an option to have a...
14
by: nma | last post by:
Hi, Can someone give ideas on how should I do this task? I've made a simple timeline using <td> and when I mouseover the cell I want it to link to another list of something and it will...
11
by: nma | last post by:
Hi How can I make the anchor link once I do onclick? <td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#00ff00" onMouseOver="this.style.background ='red'" ...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.