Can anybody tell what is the problem with this authentication
script... I can manage to get a response using curl, but not in php...
and I need to handle the response in php

      1 <?php
      2 function do_post_request($url, $data)
      3 {
      4   $params = array('http' => array(
      5                   'method' => 'POST',
      6                   'content' => $data
      7                   ));
      8   //  $params['http']['header'] = $optional_headers;
      9   $ctx = stream_context_create($params);
     10   $fp = @fopen($url, 'r', false, $ctx);
     11   if (!$fp) {
     12     throw new Exception("Problem with $url, $php_errormsg");
     13   }
     14   $response = @stream_get_contents($fp);
     15   if ($response === false) {
     16     throw new Exception("Problem reading data from $url,
$php_errormsg");
     17   }
     18   return $response;
     19 }
     20
     21
     22 $dt = 'Email=mymail%40gmail.com&Passwd=mypass&service=wise';
     23 $url = 'https://www.google.com/accounts/ClientLogin';
     24 $a = do_post_request($url,$dt);
     25 echo $a;
     26
     27 ?>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to