public function permission() { session_start(); $infoarr = @$_SESSION['user']; $media_id = @$_GET['media_id']; $type = @$_GET['ask_method']; $sql = "select*from card where media_id='{$media_id}'"; $result = new dbconnect(); $row = $result->connect($sql); if ($infoarr['openid'] != "") { if ($row['from_openid'] == $infoarr['openid'] || $row['to_openid'] == $infoarr['openid']) { if ($media_id == "") { $url = "http://weixin.faeries-land.com/test/player.html?ask_method=json&media_id={$media_id}&Token="; } else { include "../cache/" . $media_id . ".php"; $Token = $Token['token']; $url = "http://weixin.faeries-land.com/test/player.html?ask_method=json&media_id={$media_id}&Token={$Token}&ask_method=json"; } } else { $url = "http://weixin.faeries-land.com/test/player.html?ask_method=json&media_id={$media_id}&Token="; } $code = new code(); $code->code_make($url, $media_id); $this->show($row, $type); } else { $code = -1; $msg = "error:You have to use wechat app to open! "; $data = "null"; api_response::api_method($type, $code, $msg, $data); } }
public function get_status() { $UserID = $_POST['UserID']; $status = $_POST['status']; $type = $_GET['ask_method']; $res = new dbconnect(); $sql = "select* from users where UserName='******'"; $row = $res->connect($sql); if ($UserID == "" || $status == "") { $code = "409"; $msg = "error:UserID or status can not be empty!"; $data = "null"; $result = api_response::api_method($type, $code, $msg, $data); return $result; } else { if ($row['status'] == $status && $status != "") { $code = "200"; $msg = "success!"; $data = array('id' => "{$row['id']}", 'UserID' => "{$row['UserName']}", 'openid' => "{$row['openid']}", 'nickname' => "{$row['nickname']}", 'headimgurl' => "{$row['headimgurl']}", 'sex' => "{$row['sex']}", 'mobile' => "{$row['mobile']}"); $result = api_response::api_method($type, $code, $msg, $data); } else { $code = "406"; $msg = "error:Failure login status!"; $data = "null"; $result = api_response::api_method($type, $code, $msg, $data); } return $result; } }
public function show_receive() { $infoarr = @$_SESSION['user']; $type = @$_GET['ask_method']; $sql = "select*from card where to_openid='{$infoarr['openid']}'"; $result = new dbconnect(); $row = $result->connect($sql); if (empty($row)) { $code = -1; $msg = "error:The info not exist! "; $data = "null"; $result = api_response::api_method($type, $code, $msg, $data); } else { while ($row = $result->connect($sql)) { $data = array('media_id' => "{$row['media_id']}", 'title' => "{$row['title']}", 'content' => "{$row['content']}", 'create_at' => "{$row['create_at']}", 'From_nickname' => "{$row['From_nickname']}", 'To_nickname' => "{$row['To_nickname']}", 'code_url' => "http://weixin.faeries-land.com/card/ask_cardinfo.php?media_id={$row['media_id']}"); $code = 0; $msg = "success!"; $result = api_response::api_method($type, $code, $msg, $data); } } return $result; }
$search = ""; if (isset($_GET['year'])) { $year = $_GET['year']; } if (isset($_GET['region'])) { $region = $_GET['region']; } if (isset($_GET['gender'])) { $gender = $_GET['gender']; } if (isset($_GET['search'])) { $search = $_GET['search']; } // DB接続 $dbconnect = new dbconnect(); $pdo = $dbconnect->connect(); // 年 function getYear() { global $year; for ($y = date("Y"); $y >= 2003; $y--) { echo "<OPTION value='" . $y . "'"; if ($y == $year) { echo selected; } echo ">" . $y . "</OPTION>"; } echo "<OPTION value='1982' "; if ($y == 1982) { echo selected; }
public function show_info() { $type = @$_GET['ask_method']; $sql = "select*from card where openid='{$infoarr['openid']}'"; $result = new dbconnect(); $row = $result->connect($sql); if ($row) { $code = 0; $msg = "success!"; $data = array('media_id' => "{$row['media_id']}"); api_response::api_method($type, $code, $msg, $data); } else { $code = -1; $msg = "error:The info not exist!"; $data = "null"; api_response::api_method($type, $code, $msg, $data); } }
Setup file php inlog system, made by Eldin Zenderink from scratch. * I am to lazy to look up the license stuff, but: * these scripts are free for ever, I would like to see some credit, hidden on a page for example, but if you dont want to, thats fine * Also if you want to show me your project with this little login scriptie, post it here: ask.fm/rareamv */ include_once "db.php"; //database connection setup $pw = 'Negami-Senpai'; $dburl = 'mysql.grendelhosting.com'; $uname = 'u478222806_rare'; $dbname = 'u478222806_user'; //contains all things needed to connect to an database $dbsetup = array("pw" => $pw, "dburl" => $dburl, "uname" => $uname, "dbname" => $dbname); //connects to database $dbcon = new dbconnect($dbsetup); $con = $dbcon->connect(); //My db exists out of 6 columns, 1 column is an auto increment primery key called ID <- might need this in future $table = 'reg_user'; // table naam $column1 = 'nick'; //var_char(15) unique, but do whatever you need $column2 = 'password'; //tiny text, can also be var_char, but I got some problems creating my db, so i used this $column3 = 'email'; // var_char (255) <- unique, should be enough for email, could also use tiny text, but i am random $column4 = 'verificationurl'; //tiny text <- should be unique, i should use var_char here since this is random generated but with a max char of 10 XD, wups $column5 = 'verified'; //var_char(3) <- is null if not verified, if it is verified, it will change into "yes", but you can set that to whatever you want //contains all vars needed to connect to an database, including the connecting data $tablesetup = array("table" => $table, "column1" => $column1, "column2" => $column2, "column3" => $column3, "column4" => $column4, "column5" => $column5, "con" => $con);