-1

i got this error can anyone solved it before some time there is no error but today i got this error on my page

    if(isset($_GET['type'])){
if($_GET['type'] == "status"){
$beranda = json_decode(get_html("https://graph.facebook.com/$user->id/statuses?fields=id,message&limit=7&access_token=$token"))->data;
    foreach($beranda as $id){
        $status = 'isset';
    $status .= '
    <section class="status">
    <section class="image">
    <img style="-webkit-border-top-left-radius: 37px;
-moz-border-radius-topleft: 37px;
border-top-left-radius: 37px;
-webkit-border-top-right-radius: 0px;
-moz-border-radius-topright: 0px;
border-top-right-radius: 0px;
-webkit-border-bottom-right-radius: 37px;
-moz-border-radius-bottomright: 37px;
border-bottom-right-radius: 37px;
-webkit-border-bottom-left-radius: 0px;
-moz-border-radius-bottomleft: 0px;
border-bottom-left-radius: 0px;"src="https://graph.facebook.com/'.$user->id.'/picture">
    </section>
    <section class="name">'.$user->name.'</section>
    <section class="message"><span class="color">'.$id->message.'</span></section>  //// on line 131 /////
    <form action="" method="post">
    <input type="hidden" name="id" value="'.$id->id.'">
    <input type="submit" name="submit" value="Submit" class="submit"></form>
    </section>';
    }
    }
John Conde
  • 217,595
  • 99
  • 455
  • 496

1 Answers1

0

Well, obviously the returned JSON may not always contain the error property, so you should check against its existence before using it, like the following:

if (isset($user->error)) {
...
}
someOne
  • 1,975
  • 2
  • 14
  • 20