Heim >Backend-Entwicklung >PHP-Tutorial > 深夜发帖,有些灵异

深夜发帖,有些灵异

WBOY
WBOYOriginal
2016-06-13 12:54:03805Durchsuche

深夜发帖,有点灵异
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参数后面多了个空格?
------解决方案--------------------
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn