dsfs64664 2016-01-31 19:15
浏览 112

如何在URL中保留html字符编码

So I have these long URL's that enter a PHP script through a GET veriable.

<?php
$given_url = $_GET['url'];
echo $given_url;
?>

Lets say I do http://example.com/index.php?url=http://www.falstad.com/circuit/circuitjs.html?cct=%24+1+0.000005+10.200277308269968+33+5+43%0Ai+112+320+112+192+0+4%0Ai+416+192+416+320+0+6%0Ar+192+320+192+192+0+1%0Ar+208+192+320+192+0+2%0Ar+336+192+336+320+0+3%0Aw+112+192+192+192+0%0Aw+192+192+208+192+0%0Aw+320+192+336+192+0%0Aw+336+192+416+192+0%0Aw+416+320+336+320+0%0Aw+336+320+192+320+0%0Aw+192+320+112+320+0%0A

then how do I let the page echo literaly what is behind the http://example.com/index.php?url= ?

corrently is returns www.falstad.com/circuit/circuitjs.html?cct=$ 1 0.000005 10.200277308269968 33 5 43 i 112 320 112 192 0 4 i 416 192 416 320 0 6 r 192 320 192 192 0 1 r 208 192 320 192 0 2 r 336 192 336 320 0 3 w 112 192 192 192 0 w 192 192 208 192 0 w 320 192 336 192 0 w 336 192 416 192 0 w 416 320 336 320 0 w 336 320 192 320 0 w 192 320 112 320 0 as if it should process the encoded(?) characters in the URL..

  • 写回答

2条回答 默认 最新

  • dqwh1201 2016-01-31 19:19
    关注

    Use urlencode()

    echo urlencode($given_url);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入