0

I'm trying to make a photo gallery plugin for express engine, yet it's giving me this error and everything seems to close. Any help?

$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>
            ';
        }
5
  • 4
    Next time, please post a more focused snippet or tell us on that line the error occurred. Commented Jun 24, 2011 at 17:21
  • 1
    you're missing function and class closing brackets...
    – evilone
    Commented Jun 24, 2011 at 17:22
  • 1
    Side note: if (!isset($whats_gonna_happen)) will always be true
    – Pekka
    Commented Jun 24, 2011 at 17:23
  • 1
    fyi, mysql_free_result is usually not necessary ` Commented Jun 24, 2011 at 17:23
  • 1
    class name and function name are same..it means its a constructor..and better to use constructor like __construct() and also on function declaration missing ().
    – GitsD
    Commented Jun 24, 2011 at 17:28

2 Answers 2

8

The problem is here:

public function upload_pictures

should be:

public function upload_pictures()
1
  • @user677756: The little things are often the easiest to overlook. Let us know if we can help in the future. Commented Jun 24, 2011 at 17:28
3

forgot the () in your function declaration

public function upload_pictures()

your also missing 2 closing brackets in the snippet

Not the answer you're looking for? Browse other questions tagged or ask your own question.