Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i get the url if it is like this <keyword>?

Tags:

html

php

ebsearch/results/?solrsort=<keyword>

When I use $_GET['solrsort'] it is not printing the keyword.

I tried strip_tags, but it didn't work..

Any other solution?

Thanks in advance..

like image 228
Fero Avatar asked Jan 19 '26 09:01

Fero


1 Answers

Try

echo str_replace(array('<','>'),array('&lt;','&gt;'),$_GET['solrsort']);

or (better)

echo htmlspecialchars($_GET['solrsort']);

The <keyword> will not be displayed in the rendered HTML output because it looks like a tag, and strip_tags() will remove it completely for the same reason.

like image 156
DaveRandom Avatar answered Jan 20 '26 22:01

DaveRandom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!