douzhanbai9526 2013-01-26 23:42
浏览 88
已采纳

Codeigniter:从视图页面重定向到另一个URL

google-php-client example calls the authorization URL when user clicks a link. I want to call it when page loads without any user click. The way it is implemented in google-client example:

$client = new Google_Client();
$client->setApplicationName('Google Contacts PHP Sample');
$client->setScopes("http://www.google.com/m8/feeds/");
$auth = $client->createAuthUrl();
print "<a class=login href='$auth'>Connect Me!</a>";

I am trying to remove dependency on clicking on Connect Me link and call url given by $client->createAuthUrl(). I am new to Codeigniter that's why struggling on this simple task.
I check that there are following different ways to call an URL but not sure which one will work here:

  1. cURL
  2. file_get_contents
  3. stream_context_create

I am using php 5.3 with XAMPP

  • 写回答

3条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 有关c++的问题,利用相关知识
      • ¥15 求香农编码和解码的matlab代码
      • ¥20 ROS中的TEB局部规划问题
      • ¥20 关于#matlab#的问题:要求测出上面图片中所有同心圆的半径
      • ¥20 epanet软件运行问题
      • ¥15 Python 文件读取
      • ¥60 dpabi进行Alff计算时脑池有干扰信号
      • ¥15 利用kmeans或kshape聚类分析对归一化的无量纲时间-降雨序列进行聚类
      • ¥15 protel99.SE提示一下弹窗
      • ¥15 银河麒麟v10 执行.run失败如何解决