Jump to content

[SOLVED] just a question about this code..


cowboysdude

Recommended Posts

I have the following code... it works fine [when I view the html source] it's listing everything correctly but when I click on the link to open an overlay for a video it does nothing but sit there...

 

Not sure what I've missed or what is wrong but can someone give me an idea or point me in the right direction please?

 

<?php
$lines = file('modules/mod_test/files.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach($lines as $line)
{
    list($ol, $pic, $vid, $title) = explode('-', $line);
echo '<a href="#overlay" rel="#overlay'. $ol.'"><img src="/modules/mod_test/img/'. $pic .'" alt="picture here" /></a> '. $title.' <br />';
}
?>

<!-- overlays for videos -->

<?php
$lines = file('modules/mod_test/files.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach($lines as $line)
{
    list($ol, $pic, $vid, $title) = explode('-', $line);
    echo '<div class="overlay" id="overlay' .$ol .'">';
    echo "<a href='$url/clips/$vid'>";
    echo "</div><br />";
} 
?>


<!-- overlays for videos -->

Link to comment
https://forums.phpfreaks.com/topic/172762-solved-just-a-question-about-this-code/
Share on other sites

if the HTML is showing up fine, but the browser isn't doing what it should when you click on the link, that's a client-side issue and is not PHP's fault. once the HTML output is finished, PHP's job is done.

 

the problem is that you haven't defined an anchor to match the link you echo above. nowhere do you use <a name="overlay"> to define where the #overlay link should go.

if the HTML is showing up fine, but the browser isn't doing what it should when you click on the link, that's a client-side issue and is not PHP's fault. once the HTML output is finished, PHP's job is done.

 

the problem is that you haven't defined an anchor to match the link you echo above. nowhere do you use <a name="overlay"> to define where the #overlay link should go.

 

NOW that is very helpful!!! Thank you!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.