PDA

View Full Version : Dynamic Link Bug with Short Tags (and solution)


Zee
12-10-2004, 07:41 AM
Hey, just ran into this issue and thought I'd post it, as I couldn't find it listed anywhere else (although this (http://www.phpdig.net/forum/showthread.php?t=1472) thread looked like it might have been about the same issue). Please move it to the appropriate forum if this isn't the right place.

PHPDig seems to have a bit of difficulty crawling links that are dynamically generated using short tags.

For instance: while ($moreRows) {
...
?>
<a href="my_page.php?ID=<?=$row[pageID]?>">link</a>
<? } ?>
will result in a link that the PHPDig spider does not seem to crawl.

If you ouptut it this way instead: while ($moreRows) {
...
echo '<a href="my_page.php?ID=' . $row[pageID] . '">link</a>';
} the PHPDig spider finds the link and indexes the linked page properly.

This was an issue for me, as I have a ton of dynamically generated links, and I tend to use short tags rather than echo. Normally, the server has no problem with short tags - it was only with PHPDig that I encountered it as an issue. I was using PHPDig 1.8.3 as well, so it's entirely possible that this behaviour has been fixed in 1.8.4 (but I haven't yet upgraded).


Anyway, YMMV. Keep up the good work - it's an excellent tool.