Help - Search - Members - Calendar
Full Version: A little help...
HTMLHelp Forums > Programming > Server-side Scripting
cowboysdude
Ok now this will be fun.. LOL so far I"m not helping myself here....

I have a php script that when the page loads [I look at the html source] and it is loading correctly... when I click on the link it's supposed to open an overlay but currently it's not working... hummm

I was told the following:

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


Ok with that being said I'm at a loss how to make that happen exactly... here's the code...

CODE

<?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'. $ol .'" rel="#overlay'. $ol.'"><img src="/modules/mod_test/img/'. $pic .'" alt="picture here" /></a><br />'. $title.'<br /><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 class="player" href="/clips/'. $vid .'"></div>';
    
}
?>


How can I add the anchor so the overlay will fire?

THanks!! wacko.gif

pandy
Here you go.
http://htmlhelp.com/faq/html/links.html#named-anchor

Please note that it doesn't need to be an "anchor" (A tag). The text in the FAQ explains.
Christian J
Seems the script is already giving IDs to the DIV elements, but maybe the values incorrect somehow? What does the finished HTML look like?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.