<?php session_start();
if(!isset($_SESSION["tid"])  || $_SESSION["updmem"]  == false || $_SESSION["sid"] != "a") {
exi('Access denied<br/><a href=index.php>back</a>');
} include(keeplog.php");
$connect = ew mysqli("127.0.0.1", "root", "", "test");
$sql = "update members set
p = '". $_POST["p"] ."',tid = '". $_POST["tid"] ."',
listmem = ". onoff("listmem")  .",addmem = ". onoff("addmem")  .",updmem = ". onoff("updmem")  .",
sid = '" . $POST["sid"] ."',addr = '" . $_OST["addr"] ."' where u = '". $_POS["u"] ."'";
$result = $connect->query($sql);
if($result === FALSE)  echo "$sql : failed"; else echo "$sql : succeeded";
echo '<br/><a href=index.php>back</a>' ;
$connect->close(); 
// on to true
functionoff($v) { if (isset($_POST[$v])) return 1; else return 0; } ?>