0

HI 收到错误解析错误:语法错误,第 124 行 /home/crafru/public_html/test/damienform.php 中的意外 $end

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="en-gb" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<style type="text/css">
.table-style1 {
    border: 1px solid #000000;
    width: 39%;
    height: 197px;
}
.table-style2 {
    border: 1px solid #000000;
    text-align: center;
    font-weight: bold;
    height: 25px;
}
.table-style3 {
    border: 1px solid #000000;
    text-align: center;
    font-weight: bold;
    width: 221px;
    height: 25px;
}
.table-style4 {
    border: 1px solid #000000;
    width: 221px;
    height: 25px;
}
.table-style5 {
    height: 25px;
    border: 1px solid #000000;
}
</style>
</head>
<body style="font-family: Arial, Helvetica, sans-serif; background-color: #EBF4FB">
<?php
    $submitrunnertime= $_POST['submitrunnertime'];
    $RunnerID= $_POST['RunnerID'];
    $EventID= $_POST['EventID'];
    $Date= $_POST['Date'];
    $Time= $_POST['Time'];
    $Position= $_POST['Position'];
    $CategoryID= $_POST['CategoryID'];
    $AgeGrade= $_POST['AgeGrade'];
    $PB= $_POST['PB'];
    $submitrunnertime= $_POST['submitrunnertime'];
    $Test = "pass";

    $host= 'localhost';
    $user= '****';  
    $password= '****';
    $database= '****';

/**
    Function: connect to a database.
    $host = hostname to connect to e.g. 'localhost'
    $id = username identity, e.g. 'ta589'
    $pwd = user password, e.g. 'twiggy9'
    $db = database to use, e.g. 'ta589'
    Returns the database connection.
**/

function connect_db($host, $user, $password, $database) {
    $connection = @mysql_connect($host, $id, $pwd)
        or die('connection problem:' . mysql_error());
    mysql_select_db($db)
        or die('db selection problem:' . mysql_error());
    return $connection;
?>

<table class="table-style1" cellpadding="0" cellspacing="0">
    <tr>
        <td class="table-style3">Feild</td>
        <td class="table-style2">Value</td>
    </tr>
    <tr>
        <td class="table-style4">Runner ID </td>
        <td class="table-style5"><?=$RunnerID?></td>
    </tr>
    <tr>
        <td class="table-style4">Event ID </td>
        <td class="table-style5"><?=$EventID?></td>
    </tr>
    <tr>
        <td class="table-style4">Date </td>
        <td class="table-style5"><?=$Date?></td>
    </tr>
    <tr>
        <td class="table-style4">Time </td>
        <td class="table-style5"><?=$Time?></td>
    </tr>
    <tr>
        <td class="table-style4">Position </td>
        <td class="table-style5"><?=$Position?></td>
    </tr>
    <tr>
        <td class="table-style4">Category ID </td>
        <td class="table-style5"><?=$CategoryID?></td>
    </tr>
    <tr>
        <td class="table-style4">Age Grade </td>
        <td class="table-style5"><?=$AgeGrade?></td>
    </tr>
    <tr>
        <td class="table-style4">PB </td>
        <td class="table-style5"><?=$PB?></td>
    </tr>
    <tr>
        <td class="table-style4">submitrunnertime </td>
        <td class="table-style5"><?=$submitrunnertime?></td>
    </tr>
    <tr>
        <td class="table-style4">Test - Remove this</td>
        <td class="table-style5"><?=$Test?></td>
    </tr>
</table>
</body>
</html>

一直在看这个,看不到任何丢失的结束位。我错过了什么?

4

1 回答 1

4

你错过了你的功能的结束'stache。

function connect_db($host, $user, $password, $database) {
    $connection = @mysql_connect($host, $id, $pwd)
      or die('connection problem:' . mysql_error());
    mysql_select_db($db)
      or die('db selection problem:' . mysql_error());
    return $connection;
} //<--THAT ONE

?>
于 2012-08-20T14:53:49.333 回答