解析错误:语法错误,意外'{',期待'('帮忙?

时间:2011-06-24 17:20:10

标签: php parse-error

我正在尝试为快速引擎制作照片库插件,但它给了我这个错误,一切似乎都关闭了。有什么帮助吗?

$whats_gonna_happen=$_GET['pictures'];

class upload_pictures
{
    public function upload_pictures
    {
        if (!isset($whats_gonna_happen))
        {
            $uploads='';
            $cout=1;
            $stuff=$this->EE->db->query('SELECT id, name FROM albums');
            $albums_list='';
            while ($row=$stuff->result_array())
            {
                $albums_list .= "<option value=" . $row[0] . ">" . $row[1] . "</option>\n";
            }  
            mysql_free_result($stuff);
            echo '
            <html>
                <head><title>Pictures upload</title></head>
                <body>
                    <form enctype="multipart/form-data" action="upload_page.php?pictures=1" method="POST" name="stough">
                        <table width="90%" border="0" align="center" style="width: 90%">
                            <tr><td>
                                Choose album : 
                                <select name="albums">
                                ' . $albums_list . '
                                </select>
                            </td></tr>
                            <tr><td>
                                <br /> photo : <br />
                                <input type="file" name="filename"  />
                            </td></tr>
                            <tr><td>
                                Caption : <br />
                                <textarea name="captions" cols="60" rows="1"></textarea>
                            </td></tr>
                            <tr><td>
                            <input type="submit" name="captions" value="Upload" />
                            </td></tr>
                        </table>
                    </form>
                </body>
            </html>
            ';
        }

2 个答案:

答案 0 :(得分:8)

问题在于:

public function upload_pictures

应该是:

public function upload_pictures()

答案 1 :(得分:3)

忘记了函数声明中的()

public function upload_pictures()

您在片段

中也缺少2个右括号