|
Posted by Todd Cary on 02/01/05 18:56
Jochem -
Here is the function:
/* Make page path */
function make_page_path($page_string, $script_name) {
$parts = explode('|', $page_string);
for ($i = 0; $i < count($parts); $i++) {
if ($i == 0) {
$page_path = '<a href="' . $script_name . '">' .
$parts[$i] . '</a>';
} else {
$page_path = $page_path . '->' . '<a href="' . $script_name
.. '">' . $parts[$i] . '</a>';
}
}
//print("Page_path: " . $page_path . "<br>");
return $page_path;
}
Here is the executing code:
$page_string = make_page_string($page_string, "Search");
$script_string = make_script_string($script_string, "search.php");
print("Page_string: " . $page_string . "<br>");
print("Script_string: " . $script_string . "<br>");
print("Url: " . $url . "<br>");
$page_path = make_page_path($page_string, $script_string, $url);
print($page_path);
To see it execute, this URL will do it:
http://209.204.172.137/casesearch/php/search.php?search_text=***&page_string=Home&script_string=home.php
The Title area contains
<? print($page_path); ?>
The function that creates the link(s) is
/* Make page path */
function make_page_path($page_string, $script_string, $path) {
$scripts = explode('|', $script_string);
$pages = explode('|', $page_string);
for ($i = 0; $i < count($scripts); $i++) {
if ($i < count($scripts) - 1) {
if ($i == 0) {
$page_path = '<a href="' . $path . $scripts[$i] . '">'
.. $pages[$i] . '</a>';
} else {
$page_path = $page_path . '->' . '<a href="' . $path .
$scripts[$i] . '">' . $pages[$i] . '</a>';
}
} else {
if ($i == 0) {
$page_path = $pages[$i];
} else {
$page_path = $page_path . '->' . $pages[$i];
}
}
}
//print("Page_path: " . $page_path . "<br>");
return $page_path;
}
Thank you for your help...
Todd
Jochem Maas wrote:
> Todd Cary wrote:
>
>> OK...I am close, but still missing something. The string returned by
>> the function is $page_path and it contains
>>
>> <a href="http://209.204.172.137/casesearch/php/search.php">Home</a>->
>
>
> ----^
> what ever else you function is doing this is probably not correct
>
>
>> <a href="http://209.204.172.137/casesearch/php/search.php">Search</a>
>>
>> And here is how the function is used:
>>
>
> funny thing is you don't show the code for the function - AND i willing to
> bet money that the function uses html_entities() - or an equivelant...
>
> you say the function returns:
>
> <a href="http://209.204.172.137/casesearch/php/home.php">Home</a>
>
> but that is bullshit (if everything else you say it true, namely a
> direct echo of the return
> value does not show a link), if you bother to look at your own source,
> then you
> will see that the string that is output is:
>
> <a
> href="http://209.204.172.137/casesearch/php/home.php">Home</a>
>
>
> actually I noticed that the site had changed a little since I happened
> to look yesterday.
> today you are dumping some debug output at the top of the page, where as
> yesterday
> you we outputting the borked link next to the logo (the home link there
> now works - I suspect
> that this is because you have reverted to functionality there?)
>
>
> post the code for the make_page_path() function!
Navigation:
[Reply to this message]
|