DewaPentol - Script PHP Register
Script PHP Register
tinggal diedit edit aja ya kawan agar sesuai dengan DataBase nya :)
Semoga Bermanfaat :D
<?php
require_once("koneksi.php");
$username = $_POST['username'];
$pass = $_POST['password'];
$nama = $_POST['nama'];
$fbid = $_POST['fbid'];
$email = $_POST['email'];
$cekuser = mysql_query("SELECT * FROM user WHERE username = '$username'");
if(mysql_num_rows($cekuser) > 0) {
echo "Account already exist!";
} else {
if(!$username || !$pass) {
echo "<script>alert('Masih ada data yang kosong!'); javascript:location.replace('register.php');</script>";
} else {
$simpan = mysql_query("INSERT INTO user(fbid,username,password,nama,level,saldo,uplink,email) VALUES('$fbid','$username','$pass','$nama','Member','0','FreeReg','email')");
if($simpan) {
echo "<script>alert('Register Success, Please Login'); javascript:location.replace('login.php');</script>";
} else {
echo "Failed Bos!";
}
}
}
?>
Sekian dari saya, Share and Enjoy!