标签: parse-error

PHP分析错误:缺少一个; 在if声明中?

我运行一些代码时出现此错误:

解析错误:语法错误,意外T_IF,期待','或';' 在第31行的C:\ xampp\htdocs\scanner\mine.php中

第31行是:

      if($_POST['thename']) {
Run Code Online (Sandbox Code Playgroud)

我是从它得到的:

  echo '<h6>Settings</h6>';
  echo '<form action="" method="post">';
  echo '<b>Name:</b> <input type="text" name="thename" />';
  echo '<br /><input type="submit" value="Submit" />';
  echo '<hr><br />'
Run Code Online (Sandbox Code Playgroud)

导致解析错误的原因是什么?

php if-statement parse-error

0
推荐指数
1
解决办法
218
查看次数

PHP,解析错误:语法错误,意外T_IF,期待T_FUNCTION

Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in C:\wamp\www\Exam Creator\cls_FillInTheBlank.php on line 31

我在尝试运行包含cls_template.php的cls_FillInTheBlank.php时收到此错误.我在评论中发布了这两个文件.

cls_FillInTheBlank.php

<?php

    include("cls_template.php");

class fillintheblank{

    function _construct(){
        $cls_blankInput = new template;
        $cls_questionString = new template;
        $cls_fillInTheBlank = new template;
    }

    if(class_exists($cls_blankInput)){
        $cls_blankInput->fillString("<input type='text' name='[qInputName]' id='[qInputId]' value='[qInputValue]' />");
        $cls_blankInput->fillPlaceholderStrings(array("[qInputName]","[qInputId]","[qInputValue]"));
    } else {
        print("\$cls_blankInput not defined.<br>");
    }

    if(class_exists($cls_questionString)){
        $cls_questionString->fillString("");    // to be set later
        $cls_questionString->fillPlaceholderStrings(array("[fib_blank]"));
    } else {
        print("\$cls_questionString not defined.<br>");
    }

    if(class_exists($cls_fillInTheBlank)){
        $cls_fillInTheBlank->fillString("<li>[qFillInTheBlankString]</li>");
        $cls_fillInTheBlank->fillPlaceholderStrings(array("[qFillInTheBlankString]"));
    } else {
        print("\$cls_fillInTheBlank not defined.<br>");
    }

    public function q_fib_buildString($cls_question){
        $i_qID = …
Run Code Online (Sandbox Code Playgroud)

php parse-error

-1
推荐指数
1
解决办法
3万
查看次数

为什么在输入"|"时抱怨Haskell解析错误 在这个功能?

我应该在Haskell中编写一个小函数,它应该擦除列表中两次的元素.不幸的是,Haskell抱怨"输入错误'|'' ".有人可以帮我吗?

makeSets=mSet[]s
         where 
            mSet stack []=stack
            mSet stack (x:xs)
                             |contains stack x=mSetstack xs
                             | otherwise =mSet (x:stack) xs
                                          where 
                                                contains [] thing=False
                                                contains (x:xs)thing
                                                                     | x==thing=True
                                                                     |otherwise=contains xs thing
Run Code Online (Sandbox Code Playgroud)

haskell parse-error

-1
推荐指数
1
解决办法
905
查看次数

获取错误"模式中的解析错误:长度失败,模块已加载:无"

 --To check the list is in ascending order or not
 ascending::[Int]->Bool
 ascending [] =True
 ascending ((length l) == 1) =True 
 ascending l  =((head l)<=l !! 1) && ascending(tail l)
Run Code Online (Sandbox Code Playgroud)

这是我的Haskell代码,当我尝试在GHCI解释器中运行此代码时,我收到以下错误:

  ascending.hs(File_name):4:13: Parse error in pattern: length
  Failed, modules loaded: none.
Run Code Online (Sandbox Code Playgroud)

谁能告诉我这个bug在哪里?

haskell parse-error

-1
推荐指数
1
解决办法
464
查看次数

为什么 Haskell 在输入“-&gt;”时给我这个解析错误?

我浏览了 stackoverflow 试图解决这个问题,因为我看到很多标题与我的问题相同的问题。但是我在 Haskell 文件中遇到了这个解析错误,该文件在我上次打开它时工作得很好。我收到此错误消息 在此输入图像描述

haskell parse-error visual-studio

-1
推荐指数
1
解决办法
227
查看次数

不可能出现意外的'{'解析错误

我不确定在他们排队后我能读多少次关于大括号,括号和分号的帖子.这已经让我困扰了好几个小时.任何见解将不胜感激.

这个程序一天中大部分时间都处于打开和关闭状态.当我发布它并且它有效时,我会看到需要注意的细节.有时候对它进行调整就会崩溃,就像这样.

文本内容无关紧要,因为在解决之后问题仍然存在.说它是第98行.

代码缩进是否正确?我试过了.

ini_set ('display_errors', 1);
error_reporting (E_ALL | E_STRICT);

require ('head_metas.htm');
require ('head_menus.htm');

//bid_handler.php

// get items
$title = trim($_POST['title']);
$img = trim($_POST['img']);
$medium = trim($_POST['medium']);
$size = trim($_POST['size']);
$date = trim($_POST['date']);
$value = trim($_POST['value']);

// visitor info
$visitorF = trim($_POST['visitorF']);
$visitorL = trim($_POST['visitorL']);
$phone = trim($_POST['phone']);
$email1 = trim($_POST['email1']);
$email2 = trim($_POST['email2']);
$validation1 = filter_var($email1, FILTER_VALIDATE_EMAIL);
$validation2 = filter_var($email2, FILTER_VALIDATE_EMAIL);

$bid_value = trim($_POST['bid_value']);

// confirmation mails
$headers = '...';
$to = 'my@email.com, $email1';
$subject = '...';
$message …
Run Code Online (Sandbox Code Playgroud)

php parse-error

-3
推荐指数
1
解决办法
86
查看次数

标签 统计

parse-error ×6

haskell ×3

php ×3

if-statement ×1

visual-studio ×1