dr5648 2012-08-20 14:52
浏览 13
已采纳

PHP Error Parse错误:语法错误,意外$ end

HI getting an error Parse error: syntax error, unexpected $end in /home/crafru/public_html/test/damienform.php on line 124

<!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>

Been looking at this and can't see any missing end bits. What am i missing?

  • 写回答

1条回答 默认 最新

  • du8794 2012-08-20 14:53
    关注

    You're missing a closing 'stache on your function.

    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
    
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测