Page 1 of 1

question about opening a new window, not what you think.

Posted: Mon Feb 08, 2010 10:21 pm
by justAnoob
I'm looking to have a link called 'watch'
when you click the link, a new page would open displaying a video
the video is actaully a row in the database $row['video_loc']
i have the script to display the video on the same page right now. I would love for the video to open in a new window. I have been struggling for days now. Can anyone help me out? oh yeh, the new window is named showvideo.php.... Here is what I have come up with, but no luck yet

Code: Select all

 
echo '<a href="{Watch}"onClick="window.open("showvideo.php?loc={$row["video_loc"]}","window_name","width=900");return false\">$row["video_loc"]</a>';
 

Re: question about opening a new window, not what you think.

Posted: Mon Feb 08, 2010 10:53 pm
by justAnoob
Here is a small part of the script, but the important part

Code: Select all

 
echo '<span class="names">Posted on:</span><br>';
echo 'posted on';
echo '</td></tr></table></td><td width="425">';
$clicky = $row['video_loc'];
?>
<a href="showvideo.php?take_over="<?php echo $clicky; ?> target="_blank">Watch</a>
<?php
echo '</td></tr></table></td></tr>';
    
}
echo "</table>";
 
With this, It is displaying the video and the the watch link.
I forgot to mention that the record in the db, $row['video_loc'] is actually the embed code from a youtube video.
For some reason I can't get $clicky to pass through the url so it will display on a new window.

Re: question about opening a new window, not what you think.

Posted: Tue Feb 09, 2010 4:26 pm
by social_experiment
Could you please paste the code that you use to get :

Code: Select all

<?php $clicky = $row['video_loc']; ?>

Re: question about opening a new window, not what you think.

Posted: Tue Feb 09, 2010 5:00 pm
by a.heresey
You are closing the href attribute before you echo the url

Code: Select all

<a href="showvideo.php?take_over="<?php echo $clicky; ?> target="_blank">Watch</a>
should be this

Code: Select all

# <a href="showvideo.php?take_over=<?php echo $clicky; ?>" target="_blank">Watch</a>