~skye/poker/act/about.php

view raw


<?php

/* set user about info */

require '../com.php';
require '../src/db.php';

try {
	form_has_post([
		"about" => [0, 255]
	]);
} catch (Exception $e) {
	exit(page_err(
		"invalid form parameters: " . $e->getMessage()
	));
}

$db = new Database("../run/poker.db");
$me = whoami($db);

if (!!$me) {
	$a = SQLite3::escapeString($_POST["about"]);
	$db->new_info([
		"uid" => $me->id,
		"about" => $a
	]);

	header("Location: /act/admin.php?id={$me->id}");
} else {
	echo page_err("not logged in.");
}

?>