Login
require_once('facebook.php'); $config = array( 'appId' => 'YOUR_APP_ID',//809203845855838 'secret' => 'YOUR_APP_SECRET',//564f7c4320c406561d0367d029440248 ); $facebook = new Facebook($config); $user_id = $facebook->getUser(); if($user_id) { try { $ret_obj = $facebook->api('/me/feed', 'POST', array( 'link' => 'www.toiyeu5ptamn.blogspot.com', 'message' => 'Posting with the PHP SDK! on http://toiyeu5ptamn.blogspot.com' )); echo '
Post ID: ' . $ret_obj['id'] . '
'; } catch(FacebookApiException $e) { $login_url = $facebook->getLoginUrl( array( 'scope' => 'publish_stream' )); echo 'Please login.'; error_log($e->getType()); error_log($e->getMessage()); } echo '
logout'; } else { $login_url = $facebook->getLoginUrl( array( 'scope' => 'publish_stream' ) ); echo 'Please login.'; }

Thứ Sáu, 14 tháng 8, 2015

o

g

@charset "utf-8"; /* CSS Document */ a{text-decoration:none; color:#006699} a:hover{color:#00FF00; text-decoration:none} #thongtinphanhoi{background:#F0FFFF;; width:710px; height:1500px; line-height:30px} #noidungconthongtinphanhoi{background:#F0FFFF; width:600px; height:400px; margin:50px; line-height:30px} #tieuchuannguoidung{background:#000000; width:600px; height:32px; line-height:30px; color:#FFFFFF; border-top-left-radius:8px;border-top-right-radius:8px;} #caucotendangnhap{background:#F0FFFF; width:600px; height:80px; line-height:30px; color:#333333 } #caucotendangnhap1{background:#F0FFFF; width:600px; height:30px; line-height:30px; } #caucotendangnhap21{background:#F0FFFF; width:600px; height:24px; line-height:23px; } #cuasodangnhap{background:#F0FFFF; width:600px; height:38px; line-height:23px; } #cuasodangnhap1{background:#F0FFFF; width:170px; height:28px; line-height:23px; margin:5px; float:left} #cuasodangnhap2{background:#F0FFFF; width:380px; height:28px; line-height:23px; margin:5px; float: left} #1{width:350px; height:25px; border-radius:20px}

f

// Thiết lập charset utf8 header('Content-Type: text/html; charset=utf-8'); // Vì tên button submit là do-register nên ta sẽ kiểm tra nếu // tồn tại key này trong biến toàn cục $_POST thì nghĩa là người // dùng đã click register(submit) if (isset($_POST['do-register'])) { // Lấy thông tin // Để an toàn thì ta dùng hàm mssql_escape_string để // chống hack sql injection $username = isset($_POST['username']) ? mysql_escape_string($_POST['username']) : ''; $password = isset($_POST['password']) ? md5($_POST['password']) : ''; $email = isset($_POST['email']) ? mysql_escape_string($_POST['email']) : ''; $phone = isset($_POST['phone']) ? mysql_escape_string($_POST['phone']) : ''; $level = isset($_POST['level']) ? (int)$_POST['level'] : ''; // Validate Thông Tin Username và Email có bị trùng hay không // Kết nối CSDL $conn = mysqli_connect('localhost', 'root', 'vertrigo', 'demo') or die ('Lỗi kết nối'); mysqli_set_charset($conn, "utf8"); // Kiểm tra username hoặc email có bị trùng hay không $sql = "SELECT * FROM member WHERE username = '$username' OR email = '$email'"; // Thực thi câu truy vấn $result = mysqli_query($conn, $sql); // Nếu kết quả trả về lớn hơn 1 thì nghĩa là username hoặc email đã tồn tại trong CSDL if (mysqli_num_rows($result) > 0) { // Sử dụng javascript để thông báo echo ''; // Dừng chương trình die (); } else { // Ngược lại thì thêm bình thường $sql = "INSERT INTO member (username, password, email, phone, level) VALUES ('$username','$password','$email','$phone', '$level')"; if (mysqli_query($conn, $sql)){ echo ''; } else { echo ''; } } }

g

Username
Password
Email
Phone
Level

c

SinhVienIT.Net - Khoi tao CSDL (Huong Dan tao trang dang ki/Dang Nhap) require_once("mysql.php"); @$create=mysql_query("CREATE TABLE `members` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT , `username` VARCHAR( 128 ) NOT NULL , `password` VARCHAR( 32 ) NOT NULL , `email` VARCHAR( 255 ) NOT NULL , `URLS` VARCHAR( 255 ) NOT NULL , `Name` VARCHAR( 255 ) NOT NULL , `Birthday` VARCHAR( 255 ) NOT NULL , `admin` INT( 1 ) NOT NULL DEFAULT '0' , PRIMARY KEY ( `id` ) ) TYPE = MYISAM ;"); @$add_admin=mysql_query(" INSERT INTO `demo`.`members` ( `id` , `username` , `password` , `email` , `URLS` , `Name` , `Birthday` , `admin` ) VALUES ( NULL , 'admin', MD5( 'admin' ) , 'admin@sinhvienit.net', 'http://sinhvienit.net', 'Vũ Thanh Lai', '29/09/1990', '1' ); "); if ($create) print "Table \"members\" đã được tạo.
"; else print "Table \"members\" chưa được tạo do lỗi truy vấn SQL.
"; if ($add_admin) print "TK Admin:
User: admin
Pass:admin
"; else print "Ko thể tạo tài khoản admin vì lỗi SQL.
"; echo 'Click vào đầy để xem Demo'; ?>

Đăng Ký

cocolee.info

Chào mừng các bạn đến với diễn đàn cocolee.info





//Kiem tra button Register if(isset($_POST["btnRegister"])) { mysql_connect("localhost","root","")or die("Not connect host"); mysql_select_db("login")or die("Not select database"); if(!$_POST["txtFullName"] || !$_POST["txtUserName"] || !$_POST["txtPassword"]) { echo "

Nhập đầy đủ thông tin

"; exit(); } //mã hóa password $_POST["txtPassword"]=md5($_POST["txtPassword"]); $check=mysql_query("select UserName from users where UserName = '$_POST[txtUserName]'"); if(mysql_num_rows($check)==0) { $result=mysql_query("insert into users (FullName, UserName, Password) value('$_POST[txtFullName]','$_POST[txtUserName]','$_POST[txtPassword]')"); if($result) { echo "

Đăng ký thành công Quay về Trang chủ

"; } else echo "

Lỗi đăng ký

"; } else { echo "

Tên đăng nhập đã có người sử dụng

"; } } ?>
version="1.0" encoding="UTF-8"?> Viettel *99# 0 e-connect 1 1 IP PAP 0 0