dsh12544
dsh12544
2016-06-22 10:04

在PHP中执行GET时,URL会截断特殊字符

  • php
  • html
  • url

I have this domain

https://test.com/?url=https://google.com/search?q=#ie7&rls=login.microsoft:en-US:IE-Address&ie=&oe=#

And this is the code:

<?php
 //check if the url parameter exists 
 if(isset($_GET['url'])) $url=$_GET['url'];
 else $url=FALSE;
?>

If I use this in the html
<?=(!$url) ? '' : $url ?>

I get an output that cuts off in special characters like # or & etc.. and becomes like this for example https://google.com/search?q=# I tried urlencode/decode but couldn't figure it out

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐