示例#1
0
    echo "<br /><b>STARTING CURL {$protocol} CONNECTION TEST....</b><br />\n";
    global $curlContent;
    $curlContent = "";
    $curl = curl_init($protocol . '://noc1.wordfence.com/');
    curl_setopt($curl, CURLOPT_TIMEOUT, 900);
    curl_setopt($curl, CURLOPT_USERAGENT, "Wordfence.com UA " . (defined('WORDFENCE_VERSION') ? WORDFENCE_VERSION : '[Unknown version]'));
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($curl, CURLOPT_HEADER, 0);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_WRITEFUNCTION, 'curlWrite');
    $curlResult = curl_exec($curl);
    $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    if (strpos($curlContent, 'Your site did not send an API key') !== false) {
        echo "Curl connectivity test passed.<br /><br />\n";
    } else {
        $curlErrorNo = curl_errno($curl);
        $curlError = curl_error($curl);
        echo "Curl connectivity test failed with response: <pre>{$curlContent}</pre>";
        echo "<br />Curl HTTP status: {$httpStatus}<br />Curl error code: {$curlErrorNo}<br />Curl Error: {$curlError}<br /><br />\n";
    }
}
doCurlTest('http');
doCurlTest('https');
doWPostTest('http');
doWPostTest('https');
?>
</body>
</html>

示例#2
0
// dofsockTest('ipnpb.paypal.com', 443);
// doCurlTest('https://ipnpb.paypal.com');
echo 'Connecting to PayPal Express/Pro Server ...<br>';
doCurlTest('https://api-3t.paypal.com/nvp');
echo 'Connecting to PayPal Express/Pro Sandbox ...<br>';
doCurlTest('https://api-3t.sandbox.paypal.com/nvp');
echo 'Connecting to PayPal Payflowpro Server ...<br>';
doCurlTest('https://payflowpro.paypal.com/transaction');
echo 'Connecting to AuthorizeNet Production Server ...<br>';
doCurlTest('https://secure.authorize.net/gateway/transact.dll');
echo 'Connecting to AuthorizeNet Developer/Sandbox Server ...<br>';
doCurlTest('https://test.authorize.net/gateway/transact.dll');
echo 'Connecting to First Data GGe4 server (SSL)...<br>';
doCurlTest('https://checkout.globalgatewaye4.firstdata.com/payment');
echo 'Connecting to LinkPointAPI server (port 1129)...<br>';
doCurlTest('https://secure.linkpt.net/LSGSXML:1129');
?>

<em>Testing completed. See results above.</em>
</body>
</html>

<?php 
die;
//////// Processing logic ///////
function doCurlTest($url = 'http://www.zen-cart.com/testcurl.php', $postdata = "field1=This is a test&statuskey=ready")
{
    global $goodMessage, $errorMessage, $showDetails;
    $extraMessage = '';
    $showResult = FALSE;
    if (strpos($url, 'zen-cart.com') && isset($_GET['z']) && $_GET['z'] != '0') {