dua6992 2013-06-06 20:02
浏览 52

这里的错误是什么?

It is probably a silly mistake but i'm into splits because of it :(

Language : PHP 5.4.7 Framework: CodeIgniter 2.1.3 , SDK: Facebook PHP SDK 3.2.2

Please consider the following Controller function:-

public function index()
{
  //  $this->__construct();
    $data['profile'] = $this->_facebook->api('/me?fields=id');
    $this->load->view('user_profile',$data);
}

And the corresponding view (user_profile.php) :-

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Showing the user profile</title>
</head>
<body>

<?php
//echo print_r($user_profile,TRUE);
echo '<IMG SRC="http://graph.facebook.com/'. $profile['id'] . '/picture" HEIGHT=32 WIDTH=32 /> ';
?>
</body>
</html>

The above code shows the profile picture in Internet Explorer but in Chrome the page is blank. On viewing page source, it is blank.

  • 写回答

1条回答 默认 最新

  • dpf71390 2013-06-06 20:07
    关注

    I would start with writing cleaner html.

    <img src="http://graph.facebook.com/<?php echo $profile['id']; ?>/picture" alt="Profile Photo" height="32" width="32" />
    

    Don't capitalize tags and img requires an alt attribute. I always quote attribute values, even when they're numbers.

    评论

报告相同问题?

悬赏问题

  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)