transform XML nodeValue to PHP/HTML string

后端 未结 1 1184
别跟我提以往
别跟我提以往 2021-01-26 05:28

I am using AJAX live search to generate user-profile-specific links. It works well, I always end up at the profile I want to, but there ist an issue.

Let\'s do this for

相关标签:
1条回答
  • 2021-01-26 06:06

    The problem you are getting arises from the fact that your code adds spaces and a plus sign to the resulting link. And spaces are automatically encoded as %20. The solution would be to remove them from the code like this:

    $hint=  "<a href='profile.php?user=" . 
             $z->item(0)->childNodes->item(0)->nodeValue .
             "&page=profile' >" .
             $y->item(0)->childNodes->item(0)->nodeValue . "</a><span> (profile)</span>";
    

    This change would need to be done in all four occurences.

    0 讨论(0)
提交回复
热议问题