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

curl-and-php

forwarding post requests

From: Yigit Ahmet <gro.tiiy_at_yiit.org>
Date: Sun, 16 Sep 2007 01:23:16 +0300

hi there,

my country had blocked whole w"o"r"d"p"r"e"s"s.com and it's subdomains. so,
i basically programmed a proxy site for only that site with curl. adress is
w"o"r"d"p"r"e"x"y.com. (without quotes of course, i dont want this to be
indexed.) but i'm having some problems with forwarding post variables. my
code is like this:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $adres);
if ($_POST){
foreach ($_POST as $nedir => $degermi) $postedicem.=$nedir."=".$degermi."&";
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postedicem);
echo "Debug: $postedicem";
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$ahmet=curl_exec($ch);
curl_close($ch);
echo $ahmet;

if you can look at http://www.w"o"r"d"p"r"e"x" y.com/wp-login.php you can
see that nothing happens if you hit submit button, except a page reload. how
can i forward the values to original form?

thanks.

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