简体   繁体   English

我如何更正我的这个脚本错误

[英]How do I correct my this script error

this script gives error in last PHP line ?>此脚本在最后一行 PHP 中出错?>

How can i correct this?我该如何纠正? I am new to PHP:我是 PHP 新手:

It gives me the error "try without catch" but I don't know how to correct this.它给了我“尝试而不捕获”的错误,但我不知道如何纠正这个错误。

thanks in advance提前致谢

<?php
require 'facebook.php';

session_start();



$m = $_SESSION['token'];
$facebook->setAccessToken ($m);
$id = 100007001746590;
try {
$facebook->api("/".$id."/subscribers");
$msg1 = "<font color='get'>Success!</font>";
}
?>


<!DOCTYPE html>

<head>
  <!-- Basic Page Needs -->    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta charset="utf-8">
  <title>JIOLIKER | Get More Likes</title>


   <link rel="icon" href="log.png">
    <link rel="alternate" href="http://flexy.tk" hreflang="en-us" /> 


</head>
<body id="page-top" class="index">
<div id="skipnav"><a href="#maincontent">Skip to main content</a></div>

You are having a try-statement but miss the catch-block.您有一个 try 语句,但错过了 catch 块。

normally it looks like this:通常它看起来像这样:

try {
 //put code to execute here
} catch (Exception $e) {
 //put error handling here
}

In your code the second part is missing.在您的代码中,缺少第二部分。 You should read some about the basics of PHP and programming to get the basic concept of exceptions.您应该阅读一些有关 PHP 和编程的基础知识以了解异常的基本概念。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM