dongti8535 2013-05-24 18:53
浏览 66
已采纳

PHP不会选择我传递给URL的长URL参数,无论如何?

I'm passing a very long URL parameter in the URL below .. but it only returns "[" with the get method .. Below is the URL

What can I do to fix this .. What I actually did in php is this, the variable $data_for_chart contains the whole parameter that you see above .. It's imperative that I have the parameters with brackets and commas that separate it because I will use it to generate the google charts in productsum2.php

 echo "<p><a class='iframe' href='productsums2.php?id=".$data_for_chart."'>Outside Webpage (Iframe)</a></p>"; 

<a class='iframe' href='productsums2.php?id=['Tutorial', 0],
['Website How To', 0],
['Photos', 0],
['Tutorial', 0],
['Website How To', 0],
['Photos', 0],
['Core Values', 0],
['Corporate Tour', 0],
['Customer Testimonials', 0],
['Introduction', 0],
['Electrical Assemblies', 0],
['Electrical Connectors', 0],
['Air Assemblies', 0],
['Air Connectors', 0],
['Wire & Cable', 0],
['Battery Terminals & Accessories', 0],
['Wire Terminals', 0],
['Heat Shrink Tubing', 0],
['Cable/Wire Support & Accessories', 0],
['Trailer Harness System', 0],
['Dome Lamps & Controllers', 0],
['Tools', 0],
['Traffic Builders', 0],
['Full Catalog', 0],
['CSA QWIK-FIX Roadside Repair Kit', 0],
['Anodized Swinger Gladhand', 0],
['STA-LOCK Cast Iron Swinger Gladhand', 0],
['Battery Status Indicator', 0],
['QBOX', 0],
['CHARGE-BOX', 0],
['Tracker Bar Spring Kit', 0],
['STA-DRY Document Holder', 0],
['24 Volt Fleet Essential', 0],
['L-ALC - ABS Lectracoil 02-03-11', 0],
['L-BSI - Battery Status Indicator  NEW 2-06-12', 0],
['L-EALA - Elec and Air Line Assy 3n1.pdf', 0],
['L-EHD - STA-DRY Harness Brochure 2-06-12', 0],
['L-LWWT - LECTRACOIL with WEATHER-TITE 02-08-12', 1],
['L-PA - Polar Air', 0],
['L-PLXB - PERMALITE XB', 0],
['L-QCS2 - QCS2', 1],
['L-QE - QWIK-E', 0],
['L-S7WC - STA-DRY 7-Way Connetors 2-07-12', 0],
['L-SLCISG - Cast Iron Swinger Gladhands', 0],
['L-SLG - STA-LOCK Gladhand', 0],
['L-SLIM -  Slim-7', 1],
['L-SQCMS - STA-DRY QCMS 02-08-12', 1],
['L-ST - STA-DRY Tracker 02-08-12', 4],
['L-SWG - Swinger Gladhand', 1],
['L-VC1 - Vcheck 1  02-09-12', 0],
['L-VC2 - Vcheck2 02-09-12', 2],
['Permalogic Family inside and outside', 4],
['STA-DRY PRO System - Brochure', 3],
['L-WTC-WEATHER-TITE', 4],
['POLAR AIR&#174;', 0],
['LECTRACOIL&#153; WITH QCP&#153; (Quick-Connect Plug)', 0],
['PERMALITE&#153; XB', 0],
['PERMALOGIC&#153; FAMILY', 0],
['STA-DRY&#174; 7-Way Connectors', 0],
['STA-DRY&#174; 7-Way Connectors ', 0],
['QWIK-E&#174; Gladhand ', 0],
['STA-DRY&#174; SLIM7&#153; ', 0],
['STA-DRY&#174;  QCS2&#153;', 1]'>Outside Webpage (Iframe)</a></p>                  
  • 写回答

2条回答 默认 最新

  • doumeinuoye81969 2013-05-24 18:57
    关注

    You need can try to URL encode that before trying to pass it.

    PHP Code

    $Param = <<<LONG
    ['Tutorial', 0],
    ['Website How To', 0],
    ['Photos', 0],
    ['Tutorial', 0],
    ['Website How To', 0],
    ['Photos', 0],
    ['Core Values', 0],
    ['Corporate Tour', 0],
    ['Customer Testimonials', 0],
    ['Introduction', 0],
    ['Electrical Assemblies', 0],
    ['Electrical Connectors', 0],
    ['Air Assemblies', 0],
    ['Air Connectors', 0],
    ['Wire & Cable', 0],
    ['Battery Terminals & Accessories', 0],
    ['Wire Terminals', 0],
    ['Heat Shrink Tubing', 0],
    ['Cable/Wire Support & Accessories', 0],
    ['Trailer Harness System', 0],
    ['Dome Lamps & Controllers', 0],
    ['Tools', 0],
    ['Traffic Builders', 0],
    ['Full Catalog', 0],
    ['CSA QWIK-FIX Roadside Repair Kit', 0],
    ['Anodized Swinger Gladhand', 0],
    ['STA-LOCK Cast Iron Swinger Gladhand', 0],
    ['Battery Status Indicator', 0],
    ['QBOX', 0],
    ['CHARGE-BOX', 0],
    ['Tracker Bar Spring Kit', 0],
    ['STA-DRY Document Holder', 0],
    ['24 Volt Fleet Essential', 0],
    ['L-ALC - ABS Lectracoil 02-03-11', 0],
    ['L-BSI - Battery Status Indicator  NEW 2-06-12', 0],
    ['L-EALA - Elec and Air Line Assy 3n1.pdf', 0],
    ['L-EHD - STA-DRY Harness Brochure 2-06-12', 0],
    ['L-LWWT - LECTRACOIL with WEATHER-TITE 02-08-12', 1],
    ['L-PA - Polar Air', 0],
    ['L-PLXB - PERMALITE XB', 0],
    ['L-QCS2 - QCS2', 1],
    ['L-QE - QWIK-E', 0],
    ['L-S7WC - STA-DRY 7-Way Connetors 2-07-12', 0],
    ['L-SLCISG - Cast Iron Swinger Gladhands', 0],
    ['L-SLG - STA-LOCK Gladhand', 0],
    ['L-SLIM -  Slim-7', 1],
    ['L-SQCMS - STA-DRY QCMS 02-08-12', 1],
    ['L-ST - STA-DRY Tracker 02-08-12', 4],
    ['L-SWG - Swinger Gladhand', 1],
    ['L-VC1 - Vcheck 1  02-09-12', 0],
    ['L-VC2 - Vcheck2 02-09-12', 2],
    ['Permalogic Family inside and outside', 4],
    ['STA-DRY PRO System - Brochure', 3],
    ['L-WTC-WEATHER-TITE', 4],
    ['POLAR AIR&#174;', 0],
    ['LECTRACOIL&#153; WITH QCP&#153; (Quick-Connect Plug)', 0],
    ['PERMALITE&#153; XB', 0],
    ['PERMALOGIC&#153; FAMILY', 0],
    ['STA-DRY&#174; 7-Way Connectors', 0],
    ['STA-DRY&#174; 7-Way Connectors ', 0],
    ['QWIK-E&#174; Gladhand ', 0],
    ['STA-DRY&#174; SLIM7&#153; ', 0],
    ['STA-DRY&#174;  QCS2&#153;', 1]
    LONG;
    
    echo rawurlencode($Param);
    

    Outputs

    %5B%27Tutorial%27%2C%200%5D%2C%0D%0A%5B%27Website%20How%20To%27%2C%200%5D%2C%0D%0A%5B%27Photos%27%2C%200%5D%2C%0D%0A%5B%27Tutorial%27%2C%200%5D%2C%0D%0A%5B%27Website%20How%20To%27%2C%200%5D%2C%0D%0A%5B%27Photos%27%2C%200%5D%2C%0D%0A%5B%27Core%20Values%27%2C%200%5D%2C%0D%0A%5B%27Corporate%20Tour%27%2C%200%5D%2C%0D%0A%5B%27Customer%20Testimonials%27%2C%200%5D%2C%0D%0A%5B%27Introduction%27%2C%200%5D%2C%0D%0A%5B%27Electrical%20Assemblies%27%2C%200%5D%2C%0D%0A%5B%27Electrical%20Connectors%27%2C%200%5D%2C%0D%0A%5B%27Air%20Assemblies%27%2C%200%5D%2C%0D%0A%5B%27Air%20Connectors%27%2C%200%5D%2C%0D%0A%5B%27Wire%20%26%20Cable%27%2C%200%5D%2C%0D%0A%5B%27Battery%20Terminals%20%26%20Accessories%27%2C%200%5D%2C%0D%0A%5B%27Wire%20Terminals%27%2C%200%5D%2C%0D%0A%5B%27Heat%20Shrink%20Tubing%27%2C%200%5D%2C%0D%0A%5B%27Cable%2FWire%20Support%20%26%20Accessories%27%2C%200%5D%2C%0D%0A%5B%27Trailer%20Harness%20System%27%2C%200%5D%2C%0D%0A%5B%27Dome%20Lamps%20%26%20Controllers%27%2C%200%5D%2C%0D%0A%5B%27Tools%27%2C%200%5D%2C%0D%0A%5B%27Traffic%20Builders%27%2C%200%5D%2C%0D%0A%5B%27Full%20Catalog%27%2C%200%5D%2C%0D%0A%5B%27CSA%20QWIK-FIX%20Roadside%20Repair%20Kit%27%2C%200%5D%2C%0D%0A%5B%27Anodized%20Swinger%20Gladhand%27%2C%200%5D%2C%0D%0A%5B%27STA-LOCK%20Cast%20Iron%20Swinger%20Gladhand%27%2C%200%5D%2C%0D%0A%5B%27Battery%20Status%20Indicator%27%2C%200%5D%2C%0D%0A%5B%27QBOX%27%2C%200%5D%2C%0D%0A%5B%27CHARGE-BOX%27%2C%200%5D%2C%0D%0A%5B%27Tracker%20Bar%20Spring%20Kit%27%2C%200%5D%2C%0D%0A%5B%27STA-DRY%20Document%20Holder%27%2C%200%5D%2C%0D%0A%5B%2724%20Volt%20Fleet%20Essential%27%2C%200%5D%2C%0D%0A%5B%27L-ALC%20-%20ABS%20Lectracoil%2002-03-11%27%2C%200%5D%2C%0D%0A%5B%27L-BSI%20-%20Battery%20Status%20Indicator%20%20NEW%202-06-12%27%2C%200%5D%2C%0D%0A%5B%27L-EALA%20-%20Elec%20and%20Air%20Line%20Assy%203n1.pdf%27%2C%200%5D%2C%0D%0A%5B%27L-EHD%20-%20STA-DRY%20Harness%20Brochure%202-06-12%27%2C%200%5D%2C%0D%0A%5B%27L-LWWT%20-%20LECTRACOIL%20with%20WEATHER-TITE%2002-08-12%27%2C%201%5D%2C%0D%0A%5B%27L-PA%20-%20Polar%20Air%27%2C%200%5D%2C%0D%0A%5B%27L-PLXB%20-%20PERMALITE%20XB%27%2C%200%5D%2C%0D%0A%5B%27L-QCS2%20-%20QCS2%27%2C%201%5D%2C%0D%0A%5B%27L-QE%20-%20QWIK-E%27%2C%200%5D%2C%0D%0A%5B%27L-S7WC%20-%20STA-DRY%207-Way%20Connetors%202-07-12%27%2C%200%5D%2C%0D%0A%5B%27L-SLCISG%20-%20Cast%20Iron%20Swinger%20Gladhands%27%2C%200%5D%2C%0D%0A%5B%27L-SLG%20-%20STA-LOCK%20Gladhand%27%2C%200%5D%2C%0D%0A%5B%27L-SLIM%20-%20%20Slim-7%27%2C%201%5D%2C%0D%0A%5B%27L-SQCMS%20-%20STA-DRY%20QCMS%2002-08-12%27%2C%201%5D%2C%0D%0A%5B%27L-ST%20-%20STA-DRY%20Tracker%2002-08-12%27%2C%204%5D%2C%0D%0A%5B%27L-SWG%20-%20Swinger%20Gladhand%27%2C%201%5D%2C%0D%0A%5B%27L-VC1%20-%20Vcheck%201%20%2002-09-12%27%2C%200%5D%2C%0D%0A%5B%27L-VC2%20-%20Vcheck2%2002-09-12%27%2C%202%5D%2C%0D%0A%5B%27Permalogic%20Family%20inside%20and%20outside%27%2C%204%5D%2C%0D%0A%5B%27STA-DRY%20PRO%20System%20-%20Brochure%27%2C%203%5D%2C%0D%0A%5B%27L-WTC-WEATHER-TITE%27%2C%204%5D%2C%0D%0A%5B%27POLAR%20AIR%26%23174%3B%27%2C%200%5D%2C%0D%0A%5B%27LECTRACOIL%26%23153%3B%20WITH%20QCP%26%23153%3B%20%28Quick-Connect%20Plug%29%27%2C%200%5D%2C%0D%0A%5B%27PERMALITE%26%23153%3B%20XB%27%2C%200%5D%2C%0D%0A%5B%27PERMALOGIC%26%23153%3B%20FAMILY%27%2C%200%5D%2C%0D%0A%5B%27STA-DRY%26%23174%3B%207-Way%20Connectors%27%2C%200%5D%2C%0D%0A%5B%27STA-DRY%26%23174%3B%207-Way%20Connectors%20%27%2C%200%5D%2C%0D%0A%5B%27QWIK-E%26%23174%3B%20Gladhand%20%27%2C%200%5D%2C%0D%0A%5B%27STA-DRY%26%23174%3B%20SLIM7%26%23153%3B%20%27%2C%200%5D%2C%0D%0A%5B%27STA-DRY%26%23174%3B%20%20QCS2%26%23153%3B%27%2C%201%5D
    

    Caveat

    Even if you do url encode it, the maximum limit for a URL is 1024kb or 2048kb based on the browser. It will still be cut off. You need to POST this or find another way to transmit it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题