Html 分析错误:语法错误,意外的T_常量\u封装的\u字符串

Html 分析错误:语法错误,意外的T_常量\u封装的\u字符串,html,syntax-error,parse-error,Html,Syntax Error,Parse Error,关于解析错误,我遇到了一个问题:语法错误,意外的T_常量\u封装的\u字符串。我在网上尝试了所有可用的解决方案,但还是一次又一次地出现同样的错误 所以问题是:解析错误:语法错误,第25行C:\wamp\www\RedCross\load.php中意外的T_常量_封装_字符串 load.php <?php include_once('connect.php'); $EventNum = $_POST['ename']; //die('You sent: ' . $selStudent);

关于解析错误,我遇到了一个问题:语法错误,意外的T_常量\u封装的\u字符串。我在网上尝试了所有可用的解决方案,但还是一次又一次地出现同样的错误

所以问题是:解析错误:语法错误,第25行C:\wamp\www\RedCross\load.php中意外的T_常量_封装_字符串

load.php

<?php

include_once('connect.php');

$EventNum = $_POST['ename'];
//die('You sent: ' . $selStudent);

//Run DB query
$query = "SELECT Price FROM events WHERE EventID = '".$EventNum."' ";
$result = mysql_query($query) or die('Fn another_php_file.php ERROR: ' .    mysql_error());
$num_rows_returned = mysql_num_rows($result);
//die('Query returned ' . $num_rows_returned . ' rows.');

//Prepare response html markup
$r = "  
        <div class='control-group'>
            <label class='control-label' for='price'>Price </label>
                <div class='controls'>
";

//Parse mysql results and create response string. Response can be an html table, a full     page, or just a few characters
if ($num_rows_returned > 0) {   
    while ($row = mysql_fetch_array($result)) {    

    $r = $r . "<input type='text' name='price' id='price' class='input-xlarge'  value = " . $row['Price'] . " readonly>";

   }
     $r = $r .  "<center>
                <button type='submit' class='btn btn-large btn- danger' name='submit' id='submit'>Join!</button>
            </center>";

//The response echoed below will be inserted into the 
echo $r;
} else {
    $r = '<p>sorry there is no available staff for this</p>';
   // $r = $r . '</select><input type="submit" name ="go" value="press me">';
$r = $r . '</div></div>';

//The response echoed below will be inserted into the 
echo $r;
}

//Add this extra button for fun

?>

将第25行中的代码更改为下一行并测试:

$r = $r . '<input type="text" name="price" id="price" class="input-xlarge"  value = ' . $row["Price"] . ' readonly>';
$r=$r';

因为它已被弃用。使用或代替。在你发布的整个代码中没有语法错误,它解析得很好。(“尽管我在前面加了空格,使这一行不在第25行,但错误仍然在第25行。”——这更像是一个指标,表明您很可能找错了地方。)除此之外,您至少应该学习语法的基本知识,以便自己修复简单的解析错误。