コード例 #1
0
ファイル: postcoord.php プロジェクト: nvhoc/egotrip
                break;
            case "icon":
                $this->update_single_field($locationid, "s", "icontype", null);
                break;
            case "txt":
                $this->update_single_field($locationid, "s", "textmessage", null);
                break;
        }
    }
    function upload_file($tmpfile)
    {
        //create a hash of the file
        $filehash = sha1_file($tmpfile);
        //we assume the file is a jpg
        $targetfile = $this->filedir . "/" . $filehash . ".jpg";
        $success = move_uploaded_file($tmpfile, $targetfile);
        if (!$success) {
            EgoLib::exit_error("could not save file");
        }
        return $filehash;
    }
}
//register your handler
$myhandler = new ExampleMysqlITripHandler();
$egolib->callback = $myhandler;
//init mysql connection
$myhandler->dbname = "gpsdata";
$myhandler->init_mysql_connection();
//tell the lib to parse the request and call your handler accordingly
$egolib->handle_request();