cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

How can I follow redirection?

From: Biligt <biligt_at_gmail.com>
Date: Thu, 10 May 2007 17:43:05 +0800

Hello, I have some problem with code below. I'm trying to send POST to the
script
and the receiving script redirects to itself. But current http address isn't
changing.
The code below is from send.php file and when it sends variable I want the
bank.php
show the receiving variable.

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,"$nt_runtime_URL");
    //curl_setopt($ch, CURLOPT_URL,"http://127.0.0.1/tdbm/bank.php");

    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_POST, 1); // TRUE to do a regular HTTP POST
    curl_setopt($ch, CURLOPT_POSTFIELDS,
"acqBIN=450318&merID=NARANTR&PurchaseAmount=$nt_vm_purchase_amount&ORDERID=$nt_vm_orderid");

    //curl_exec($ch);

    $result = curl_exec($ch);

    $intReturnCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

    print_r(curl_getinfo($ch));
    echo "\n\ncURL error number:" .curl_errno($ch);
    echo "\n\ncURL error:" . curl_error($ch);
    // ...close cURL handle ($ch) below

    curl_close ($ch);
    if ($nt_debug_mode == 1)
    {echo $result."<br/>";}

    if ($intReturnCode != 200) {
    print 'was error: ' . $intReturnCode;
     */

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-05-10