cUrl不发送POST数据php

时间:2017-11-09 14:15:40

标签: php echo php-curl

我的cURL看看我的代码有问题



www.example1.com/index.php

/(?:href|src)\=\"([^(http)][^(\")]*)\"/

www.example2.com/index.php

$Email = $_POST['Email'];
$Password = $_POST['Password'];

$sql = $dbh->prepare('SELECT * FROM users WHERE Email = ? AND Password = ?');
$sql->execute(array($Email,$Password));

if($sql->rowCount() == 1) {
    $data = array('Found'=> 'Great');
    $string = http_build_query($data);

    $ch = curl_init("http://www.example2.com/index.php");
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $string);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_exec($ch);
    curl_close($ch);
}else{
    $data = array('Found'=> 'Sorry');
    $string = http_build_query($data);

    $ch = curl_init("http://www.example2.com/index.php");
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $string);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_exec($ch);
    curl_close($ch);  
}

它没有回应任何东西 在www.example2.com中,我能做什么,我可以回应Found变量

抱歉我的英语不好,希望你能理解我,谢谢你。)

1 个答案:

答案 0 :(得分:1)

尝试将curl的输出保存为如下变量:

select neighbors.site, neighbors.neighbor, PI_Table.* from neighbors inner join PI_Table on neighbors.neighbor = PI_Table.site;