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

curl-and-php

Re: How to pass set-cookie header to browser

From: <info_at_itegic.co.za>
Date: Mon, 14 Sep 2009 04:46:43 -0500 (CDT)

> there's no way you can send cookies that appear to originate from
Clickbank to a client due to security reasons.

Thought it was a security issue...Is there any other way I can do the
cookie stuffing part, and redirect to the final altered url?

I've got the following code written in CGI\Perl which seems to do that..

sub GetLink {
        $nurl=shift;
        $id=shift;
        $ua = new LWP::UserAgent;
        $ua->agent("Mozilla/4.0");
        $req = new HTTP::Request 'GET' => $nurl;
        $req->header('Accept' => 'text/html'); Accept: text/html
        $res = $ua->request($req);
        if ($res->is_success) {
                $content=$res->headers_as_string.$res->content;
                $real_url=$res->base;
                $content=~/URL=([^\s]+)/;
                $newurl=$1;
                $real_url=~s/\?.*$//;
        } else {
                $real_url=$url;
        }

}

Any way to replicate in curl\php?

Thanks,

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-09-14