首頁 >後端開發 >php教程 > 深夜发帖,有些灵异

深夜发帖,有些灵异

WBOY
WBOY原創
2016-06-13 12:54:03798瀏覽

深夜发帖,有点灵异
Hello,

function chk_commit_query(table_name,reg_id_base, reg_id_cmp, csv_file){<br />
    if(chk_items.length === 0){<br />
        alert('no items selected! And select all items in default!');<br />
        chk_sql_base = 'select * from ' + table_name + ' where Regression_Id = ' + reg_id_base;<br />
        chk_sql_cmp  = 'select * from ' + table_name + ' where Regression_Id = ' + reg_id_cmp;<br />
    }<br />
    else{<br />
        chk_sql_base = 'select TestCase, Design_name, ';<br />
        chk_sql_cmp  = 'select TestCase, Design_name, ';<br />
        for (var i=0;i<chk_items.length - 1;i++){<br />
            chk_sql_base += chk_items[i] + ', '<br />
            chk_sql_cmp  += chk_items[i] + ', '<br />
        }<br />
        chk_sql_base += chk_items[i] + ' from ' + table_name + ' where Regression_Id = ' + reg_id_base;<br />
        chk_sql_cmp  += chk_items[i] + ' from ' + table_name + ' where Regression_Id = ' + reg_id_cmp;<br />
    }<br />
    xmlHttp=GetXmlHttpObject()<br />
    if (xmlHttp==null)<br />
    {<br />
        return<br />
    }<br />
    var url="show_cmp_internal_chk_table.php"<br />
    url=url+"?sql_chk_cmp1 ="+chk_sql_cmp;<br />
    url=url+"&sql_chk_base="+chk_sql_base;<br />
    url=url+"&csv_file="+csv_file;<br />
    url=url+"&sid="+Math.random()<br />
    alert(url);<br />
//此处得到的数据为:<fieldset><legend class="font_bold">引用</legend><blockquote>show_cmp_internal_chk_table.php?sql_chk_cmp1 =select TestCase, Design_name, Succeed, Syn from ACE_CHK_FLOW where Regression_Id = 585&sql_chk_base=select TestCase, Design_name, Succeed, Syn from ACE_CHK_FLOW where Regression_Id = 592&csv_file=ACE_20130128-0150_VS_20130130-0150_Regression_QOR_dif_2013_02_03&sid=0.5060912349899407</blockquote></fieldset><br />
    xmlHttp.onreadystatechange=chk_stateChanged <br />
    xmlHttp.open("GET",url,true)<br />
    xmlHttp.send(null)<br />
}<br />

show_cmp_internal_chk_table.php:
<?php<br />
$csv_data4 = Array();<br />
$sql_chk_cmp  = $_GET["sql_chk_cmp1"];<br />
$sql_chk_base = $_GET["sql_chk_base"];<br />
echo $sql_chk_base."<br>";<br />
echo $sql_chk_cmp."<br>";<br />
...

这里$sql_chk_base有数据,$sql_chk_cmp无论如何却为空,看url的信息也是有这个数据的,这是什么事情啊。这样的ajax代码用的少说也得数百次了。


------解决方案--------------------
莫非url参数后面多了个空格?
------解决方案--------------------
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn