cowboysdude Posted September 1, 2009 Share Posted September 1, 2009 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 More sharing options...
akitchin Posted September 2, 2009 Share Posted September 2, 2009 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 https://forums.phpfreaks.com/topic/172762-solved-just-a-question-about-this-code/#findComment-910617 Share on other sites More sharing options...
cowboysdude Posted September 2, 2009 Author Share Posted September 2, 2009 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 https://forums.phpfreaks.com/topic/172762-solved-just-a-question-about-this-code/#findComment-910630 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.