views:

65

answers:

1

hi I am trying to post data from a website (non-zend) to my zend based website. i use the php post method to post from the non-zend website which is

e.g.

$data=Array('testkey'=>'testvalue');

$query = http_build_query($data);

$host="localhost/index.php/default/proc/procnew";
$rr=post($host,$query);
function post($host,$query,$others=''){
    $path=explode('/',$host);
    $host=$path[0];
    unset($path[0]);
    $path='/'.(implode('/',$path));
    $post="POST $path HTTP/1.1\r\nHost: $host\r\nContent-type: application/x-www-form-urlencoded\r\n${others}User-Agent: Mozilla 4.0\r\nContent-length: ".strlen($query)."\r\nConnection: close\r\n\r\n$query";
    $h=fsockopen($host,80);
    fwrite($h,$post);
    for($a=0,$r='';!$a;){
        $b=fread($h,8192);
        $r.=$b;
        $a=(($b=='')?1:0);
    }
    fclose($h);
    return $r;
}

my problem is that the action seems never to recieve the post request although after enabling zend log to debug level i see this in log

2009-11-24T22:04:22-05:00 INFO (6): REQUESTED URI: /index.php/default/proc/procnew
2009-11-24T22:04:22-05:00 INFO (6): POST payload: Array
(
    [testkey] => testvalue 

)

which means that the post is sent correctly but the action does not recieve it

also i have done another test and added to file to webroot of zend that reads the request and write it to some log file and the file read the request correctly and write it to log file

so the problem is in how zend recieve the post request from another website

thanks

A: 

I am sorry I found that the problem is in the data that are sent as when ever i send a data by the key of userid the system halt

i will figure out why userid is making problems (probably somthing related to the model)

thanks for you help

haamte