PDA

View Full Version : & issue in link


TheAdminMarket
10-29-2015, 05:46 PM
Hello,

All suddently, something that was working on other cases, does not works now. I've in my code:

$title = ''.htmlspecialchars_uni($pm["title"]).' ('.$site_url.'/pms.php?do=index&pmid='.$pmid.')';

When user clicks it (in PM) the actual link in the broser becomes:

www.domain.com/pms.php?do=index&&pmid=2

If I change it to:

$title = ''.htmlspecialchars_uni($pm["title"]).' ('.$site_url.'/pms.php?do=index&pmid='.$pmid.')';

the url in the browser is:

www.domain.com/pms.php?do=index&pmid=2

but still does not works unless if I manually change in the browser & to &

Any ideas?

Thank you

MarkFL
10-29-2015, 05:53 PM
Hello,

All suddently, something that was working on other cases, does not works now.

Oh boy...I know that feeling well...LOL! :)

I've in my code:

$title = ''.htmlspecialchars_uni($pm["title"]).' ('.$site_url.'/pms.php?do=index&pmid='.$pmid.')';

When user clicks it (in PM) the actual link in the broser becomes:

www.domain.com/pms.php?do=index&&pmid=2

If I change it to:

$title = ''.htmlspecialchars_uni($pm["title"]).' ('.$site_url.'/pms.php?do=index&pmid='.$pmid.')';

the url in the browser is:

www.domain.com/pms.php?do=index&pmid=2

but still does not works unless if I manually change in the browser & to &

Any ideas?

Thank you

I suggest running $title through the function:

htmlspecialchars_decode()

and see if that fixes the issue.

Dave
10-29-2015, 06:06 PM
What about the urlencode function?
Edit: nvm, didn't read the question correctly.

TheAdminMarket
10-29-2015, 06:31 PM
@MarkFL
@Dave
------------
Finally seems that is not problem of my code but rather on how PM (show PM) parses links.
I used echo to see my link in the screen and it's correct.