Вопрос

I have a form which passing name to self:

<form>
    <input name=page size=100 value="<?=htmlspecialchars($url)?>">
    <input type=submit value="Open">
    <input type=button onclick="this.parentNode.style.display = 'none'" value="Close">
</form>

After it takes by $_GET["page"] In form when clicking open the Url looks like http://mysite.co
and $_GET["page"] is the same, but in browser navigation bar it looks like /?page=http%3A%2F%2mysite.co
How to remove encoding when i submit the form ? To get navigation bar status like
/?page=http://mysite.co

Это было полезно?

Решение

Remove this method

htmlspecialchars

from

    <input name=page size=100 value="<?=htmlspecialchars($url)?>">

to be

    <input name=page size=100 value="<?=$url?>">

After searching a while i found this stackoverflow question

Actually you can't do this but you may decode this URL for further use.

Другие советы

Use

htmlspecialchars_decode();

Also, avoid short open tags, they're disabled by default on most PHP installations, so will cause you a headache down the line if you move server, etc.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top