我正在使用PHP curl将数据发送到zoho crm,但它返回“403 forbidden”错误。现在的问题是,我使用单个curl函数在该页面上发送多个xml,当我向帐户或潜力发送数据时,它正确发送并给我成功响应,但当我尝试向联系人发送数据时,它是给我一个错误,我想说的是同样的卷曲在上面正常工作并在同一个文件中给出错误,我的意思是如果卷曲有问题为什么它会成功运行三次而不是第四次。 其次,当我把相同的代码放在localhost中时它的工作正常,这意味着我的xml也没关系,任何人都可以帮助我,我搜索过几十篇文章,但没有任何帮助,这是代码。< / p>
<?php
$auth = '************';
//creating new contact
$xml = "<Contacts>
<row no=\"1\">
<FL val=\"First Name\">James</FL>
<FL val=\"Last Name\">Franco</FL>
<FL val=\"Email\">test@test.com</FL>
<FL val=\"Department\">CG</FL>
<FL val=\"Phone\">0000</FL>
<FL val=\"Fax\">99999999</FL>
<FL val=\"Mobile\">99989989</FL>
<FL val=\"Assistant\">John</FL>
</row>
</Contacts>";
$agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13';
$p_true_url = "https://crm.zoho.com/crm/private/xml/Contacts/insertRecords?";
$p_true_query = "authtoken=" . $auth . "&scope=crmapi&newFormat=1&xmlData=" . $xml . "";
$p_true1 = curl_init();
curl_setopt($p_true1, CURLOPT_URL, $p_true_url);
curl_setopt($p_true1, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($p_true1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($p_true1, CURLOPT_TIMEOUT, 60);
curl_setopt($p_true1, CURLOPT_POST, 1);
curl_setopt($p_true1, CURLOPT_USERAGENT, $agent);
curl_setopt($p_true1, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($p_true1, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($p_true1, CURLOPT_POSTFIELDS, $p_true_query);
$p_true_response = curl_exec($p_true1);
curl_close($p_true1);
print_r($p_true_response);
?>
答案 0 :(得分:0)
远程计算机可能会阻止频繁请求。 使用中,
[self setFieldType];
NSMutableArray *kirtanList=[[NSMutableArray alloc] init];
NSString *sql = [NSString stringWithFormat:@"SELECT Id,%@ FROM Kirtan_list where Title_Eng like '%@%%' or Title_Eng like '%%%@%%' order by Title_Eng", titleField, text,text];
sqlite3_stmt * statement;
if(sqlite3_prepare_v2(db, [sql UTF8String], -1, &statement, nil) == SQLITE_OK)
{
while(sqlite3_step(statement) == SQLITE_ROW)
{
char *field1 = (char *) sqlite3_column_text(statement, 0);
NSString *field1Str = [[NSString alloc] initWithUTF8String:field1];
char *field2 = (char *) sqlite3_column_text(statement, 1);
NSString *field2Str = [[NSString alloc] initWithUTF8String:field2];
NSArray *data=[NSArray arrayWithObjects:[NSString stringWithFormat:@"%@",field1Str],[NSString stringWithFormat:@"%@",field2Str],nil ];
[kirtanList addObject:data];
}
}else{
NSLog(@"Filtered row error ");
}