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
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.

Link to comment
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.

 

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.