我运行一些代码时出现此错误:
解析错误:语法错误,意外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)
导致解析错误的原因是什么?
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) 我应该在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) --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在哪里?
我不确定在他们排队后我能读多少次关于大括号,括号和分号的帖子.这已经让我困扰了好几个小时.任何见解将不胜感激.
这个程序一天中大部分时间都处于打开和关闭状态.当我发布它并且它有效时,我会看到需要注意的细节.有时候对它进行调整就会崩溃,就像这样.
文本内容无关紧要,因为在解决之后问题仍然存在.说它是第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)