-1

解析エラーに関する問題があります: 構文エラー、予期しない T_CONSTANT_ENCAPSED_STRING。オンラインで利用可能なすべてのソリューションを試しましたが、それでも同じエラーが何度も発生しました。

問題は次のとおりです: 解析エラー: 構文エラー、25 行目の C:\wamp\www\RedCross\load.php の予期しない T_CONSTANT_ENCAPSED_STRING

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 行目は次のコードです。 ここに画像の説明を入力

この行を25行目にしないようにする前にスペースを入れても、エラーは25行目にあります。

助けてください。

4

1 に答える 1

0

25 行目のコードを以下の行に変更してテストします。

$r = $r . '<input type="text" name="price" id="price" class="input-xlarge"  value = ' . $row["Price"] . ' readonly>';
于 2013-11-02T10:08:21.057 に答える