本文整理汇总了PHP中response::set_key方法的典型用法代码示例。如果您正苦于以下问题:PHP response::set_key方法的具体用法?PHP response::set_key怎么用?PHP response::set_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类response
的用法示例。
在下文中一共展示了response::set_key方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fopen
if (DEBUG) {
$fd = fopen('debug.txt', 'a');
fwrite($fd, print_r($_POST, true));
fwrite($fd, print_r($_FILES, true));
fwrite($fd, print_r($debug_msgs, true));
fclose($fd);
}
$response = new response();
switch ($cmd) {
case 'login':
login($_POST['uname'], $_POST['password']);
break;
case 'fetch-albums':
list_albums();
break;
case 'fetch-album-images':
list_images($_POST['set_albumName']);
break;
case 'add-item':
add_image($_POST['set_albumName'], $_FILES['userfile']['name'], $_POST['caption']);
break;
case 'new-album':
// There is a title field as well, but since Plogger doesn't use it, we drop it
gr_add_album($_POST['set_albumName'], $_POST['newAlbumTitle'], $_POST['newAlbumDesc']);
break;
default:
$response->set_key('status', GR_STAT_UNKNOWN_CMD);
$response->set_key('status_text', 'Unknown command.');
}
$response->write();
close_db();
示例2: isset
$cmd = isset($_POST["cmd"]) ? $_POST["cmd"] : "";
if (DEBUG) {
$fd = fopen("debug.txt", "a");
fwrite($fd, print_r($_POST, true));
fwrite($fd, print_r($_FILES, true));
fwrite($fd, print_r($debug_msgs, true));
fclose($fd);
}
$response = new response();
switch ($cmd) {
case "login":
login($_POST["uname"], $_POST["password"]);
break;
case "fetch-albums":
list_albums();
break;
case "fetch-album-images":
list_images($_POST["set_albumName"]);
break;
case "add-item":
add_image($_POST["set_albumName"], $_FILES["userfile"]["name"], $_POST["caption"]);
break;
case "new-album":
// there is a title field as well, but since plogger doesn't use it, we drop it
gr_add_album($_POST["set_albumName"], $_POST["newAlbumTitle"], $_POST["newAlbumDesc"]);
break;
default:
$response->set_key("status", GR_STAT_UNKNOWN_CMD);
$response->set_key("status_text", "Unknown command.");
}
$response->write();