CURLOPT_POSTFIELDS中意外的T_LNUMBER

时间:2012-12-20 15:16:09

标签: php curl syntax

你好, 我收到错误

  

解析错误:语法错误,意外T_LNUMBER,期待')'...(''__'''''''''''''''''''''''''''''''''''

奇怪的是,即使我删除了报告的行甚至是错误的一堆行,错误仍然存​​在于同一个地方:它可能是什么?卷曲后场的数量或大小是否有限制?

curl_setopt($curl_connection, CURLOPT_POSTFIELDS, array(
        '__SPSCEditMenu'=>'true',
        'MSOWebPartPage_PostbackSource'=>'',
        'MSOTlPn_SelectedWpId'=>'',
        'MSOTlPn_View'=>'0',
        'MSOTlPn_ShowSettings'=>'False',
        'MSOGallery_SelectedLibrary'=>'',
        'MSOGallery_FilterString'=>'',
        'MSOTlPn_Button'=>'none',
        '__EVENTTARGET'=>'',
        '__EVENTARGUMENT'=>'',
        '__REQUESTDIGEST'=>'0x2A02AA889D8390AB95007187B517EA1C6B4766D3B39A761AD5C5211782F7F2D1D35040A5592889C1171961C6C3679849C66993F246AE5292DF1BC3A19B405F9E,20 Dec 2012 11:25:09 -0000',
        'MSOAuthoringConsole_FormContext'=>'',
        'MSOAC_EditDuringWorkflow'=>'',
        'MSOSPWebPartManager_DisplayModeName'=>'Browse',
        'MSOWebPartPage_Shared'=>'',
        'MSOLayout_LayoutChanges'=>'',
        'MSOLayout_InDesignMode'=>'',
        'MSOSPWebPartManager_OldDisplayModeName'=>'Browse',
        'MSOSPWebPartManager_StartWebPartEditingName'=>'false',
        '__LASTFOCUS'=>'',
        '__VIEWSTATE'=>$viewState,
        'ctl00_SPWebPartManager1_g_d50ea2f4_9347_49e0_9f8c_83b4ba8f7466_lines_type_rbl_2'=>'1',           
        'ctl00$SPWebPartManager1$g_d50ea2f4_9347_49e0_9f8c_83b4ba8f7466$lvsbm'=>'',         
        'ctl00$SPWebPartManager1$g_d50ea2f4_9347_49e0_9f8c_83b4ba8f7466$rd_ltype_ch'=>'0',  
        'ctl00$SPWebPartManager1$g_d50ea2f4_9347_49e0_9f8c_83b4ba8f7466$pg_v_pos'=>'0', 
        'ctl00$SPWebPartManager1$g_6a113a00_1817_4823_834b_666b7bf38e10$nldpmt'=> '500',
        'ctl00$SPWebPartManager1$g_d50ea2f4_9347_49e0_9f8c_83b4ba8f7466$pg_v_pos=>'0',
        'ctl00$SPWebPartManager1$g_6a113a00_1817_4823_834b_666b7bf38e10$txt_town'=>'milano',
        'ctl00$SPWebPartManager1$g_6a113a00_1817_4823_834b_666b7bf38e10$hh_hn'=>'';
        'ctl00$SPWebPartManager1$g_6a113a00_1817_4823_834b_666b7bf38e10$canshowroute'=>'1',
        'ctl00$SPWebPartManager1$g_6a113a00_1817_4823_834b_666b7bf38e10$pg_v_pos'=>'0',          
        'ctl00$SPWebPartManager1$g_d50ea2f4_9347_49e0_9f8c_83b4ba8f7466$txt_dp_lines_9347_49e0_9f8c_83b4ba8f7466$txt_dp_lines'=>$line,       
        'ctl00$SPWebPartManager1$g_bd2153c6_2f32_4bfa_8abb_504f3e53a69b$contextname'=>'5a4665da-c66a-4f84-87d27009ff396423-50d2f595'     
));

3 个答案:

答案 0 :(得分:1)

见这一行:

 'ctl00$SPWebPartManager1$g_d50ea2f4_9347_49e0_9f8c_83b4ba8f7466$pg_v_pos=>'0',
 'ctl00$SPWebPartManager1$g_6a113a00_1817_4823_834b_666b7bf38e10$hh_hn'=>'';

需要:

 'ctl00$SPWebPartManager1$g_d50ea2f4_9347_49e0_9f8c_83b4ba8f7466$pg_v_pos'=>'0',
 'ctl00$SPWebPartManager1$g_6a113a00_1817_4823_834b_666b7bf38e10$hh_hn'=>'',

您是否在IDE中使用语法高亮? 你用什么IDE?)

答案 1 :(得分:1)

与上述相同,但可能存在另一个问题: 'ctl00$SPWebPartManager1$g_6a113a00_1817_4823_834b_666b7bf38e10$hh_hn'=>''; 删除分号。

答案 2 :(得分:0)

你可以在降价编辑器中看到它。

您错过了'