
Originally Posted by
Shadow121
Say I have the following: ?x=ucp&y=password
I expect it to be User Panel » Password
So how exactly do you call the function?
PHP Code:
<?php
[...]
echo (doNav(array('12345','67890','abcde')));
?>
Using your initial code, I would expect it to show:
<a href="http://yoursite.com/">Index</a> » <a href="http://yoursite.com/abcde/">67890</a> » <a href="http://yoursite.com/abcde/">abcde</a>
Note that on line 13, you use the variable $links, but the only other time you used it was in the foreach loop, so you can only assume that your PHP setup is using the last iteration of that foreach as the value for $links.
I would instead use the following:
PHP Code:
function doNav($act){
$output = '<a href="http://forums.x10hosting.com/programming-help/'.SITE_LINK.'">Index</a>';
foreach($act as $link){
$output .= ' » <a href="http://forums.x10hosting.com/programming-help/'.SITE_LINK.$link.'">'.$link.'</a>';
}
return $output;
}
Called the same way, the output should now be:
<a href="http://yoursite.com/">Index</a> » <a href="http://yoursite.com/12345">12345</a> » <a href="http://yoursite.com/67890">67890</a> » <a href="http://yoursite.com/abcde">abcde</a>