<?php
header('content-type:application/json;charset=utf8');
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
?>
<?php
$sql="select * from af_users";
$query=mysql_query($sql);
while($rs=mysql_fetch_array($query)){$json_value =array('LOGIN_PHONE' => '15011577161','USER_ID' => $rs['user_id'],'USER_NAME' => $rs['USER_NAME'],'NICK_NAME' => $rs['USER_NAME'],'LOGIN_EMAIL' => $rs['email'],
'PROVINCE' => $rs['山东'],'CITY' => $rs[''],'SEX' => '0','IRTHDAY' => $rs['birthday'],'NOTE' => $rs[''],'PASSWORD' => $rs['password'],'TYPE' => '1','COM_ID' => '1',
'USER_LEVLE' => '1','USER_EXPERIENCE' => '1');
}
$json_value2=json_encode($json_value);
$url = 'http://www.sdgxyj.com/ecweb/sdcoopcoop/api/userInfo.do?method=insertPersonInfo';
$post_data = array('BUSINESS_ID' => '1257254','Key' => '61f9cf64-e367-46cf-8250-57eeb3c10726','INPUT_JSON_PARAM' => $json_value);
$data=json_encode($post_data);
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_POST,1);
curl_setopt($curl,CURLOPT_POSTFIELDS,$data); $result = curl_exec($curl); curl_close($curl);
return $result;?>
header('content-type:application/json;charset=utf8');
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
?>
<?php
$sql="select * from af_users";
$query=mysql_query($sql);
while($rs=mysql_fetch_array($query)){$json_value =array('LOGIN_PHONE' => '15011577161','USER_ID' => $rs['user_id'],'USER_NAME' => $rs['USER_NAME'],'NICK_NAME' => $rs['USER_NAME'],'LOGIN_EMAIL' => $rs['email'],
'PROVINCE' => $rs['山东'],'CITY' => $rs[''],'SEX' => '0','IRTHDAY' => $rs['birthday'],'NOTE' => $rs[''],'PASSWORD' => $rs['password'],'TYPE' => '1','COM_ID' => '1',
'USER_LEVLE' => '1','USER_EXPERIENCE' => '1');
}
$json_value2=json_encode($json_value);
$url = 'http://www.sdgxyj.com/ecweb/sdcoopcoop/api/userInfo.do?method=insertPersonInfo';
$post_data = array('BUSINESS_ID' => '1257254','Key' => '61f9cf64-e367-46cf-8250-57eeb3c10726','INPUT_JSON_PARAM' => $json_value);
$data=json_encode($post_data);
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_POST,1);
curl_setopt($curl,CURLOPT_POSTFIELDS,$data); $result = curl_exec($curl); curl_close($curl);
return $result;?>
header('content-type:application/json;charset=utf8');
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
?>
public function toPost($url,$str,$second=30){
//初始化curl
$ch = curl_init();
//设置超时
curl_setopt($ch, CURLOPT_TIMEOUT, $second);
//这里设置代理,如果有的话
//curl_setopt($ch,CURLOPT_PROXY, '8.8.8.8');
//curl_setopt($ch,CURLOPT_PROXYPORT, 8080);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,FALSE);
//设置header
curl_setopt($ch, CURLOPT_HEADER, FALSE);
//要求结果为字符串且输出到屏幕上
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
//post提交方式
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
$data = curl_exec($ch);
$result = curl_getinfo($ch);//返回结果
if($result['http_code'] == 200){
return $data;
}else{
$error = curl_errno($ch);
return false;
}
}
public function toPost($url,$str,$second=30){
//初始化curl
$ch = curl_init();
//设置超时
curl_setopt($ch, CURLOPT_TIMEOUT, $second);
//这里设置代理,如果有的话
//curl_setopt($ch,CURLOPT_PROXY, '8.8.8.8');
//curl_setopt($ch,CURLOPT_PROXYPORT, 8080);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,FALSE);
//设置header
curl_setopt($ch, CURLOPT_HEADER, FALSE);
//要求结果为字符串且输出到屏幕上
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
//post提交方式
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
$data = curl_exec($ch);
$result = curl_getinfo($ch);//返回结果
if($result['http_code'] == 200){
return $data;
}else{
$error = curl_errno($ch);
return false;
}
}