Postingan lainnya
Pembuatan auto generate kode di saat registrasi..
ane mau tanya, ane kurang paham sama php 7. ane kan mau buat form registrasi yang punya auto generate kode untuk user tersebut. tapi setelah ane coba di utak atik function phpnya malah blank putih.
ini code function php
nah yang ini form regitrasi.phpnya
Halaman Registrasi
query("SELECT * FROM master_user WHERE username = '$username' AND password = '$password'"); $mySqlIns = "INSERT INTO master_customer SET mstcustomer_code = '$empCode', mstcustomer_name = '$officeName', mstcustomer_phone = '$phone', mstcustomer_fax = '$fax', mstcustomer_email = '$email', mstcustomer_address = '$address', mstcustomer_city = '$city'"; $myQryIns = mysqli_query($koneksidb, $mySqlIns) or die ("$mySqlIns.Error ins cust.".mysqli_error());
if($myQryIns) { $mySqlInsUsr = "INSERT INTO master_user SET mstuser_code = '$userCode', mstuser_name = '$officeName', mstuser_email = '$email', mstuser_username = '$username', mstuser_password = '$password', mstuser_isactive = '0', mstcustomer_code = '$empCode'"; $myQryInsUsr = mysqli_query($koneksidb, $mySqlInsUsr) or die ("$mySqlInsUsr.Error ins usr.".mysqli_error()); }
/*if($jmluser>0) { $_SESSION['username'] = $data['mstuser_username']; $_SESSION['namalengkap'] = $data['mstuser_name']; $_SESSION['password'] = $data['mstuser_password']; $_SESSION['SES_MSTUSER_CODE'] = $data['mstuser_code']; $_SESSION['leveluser'] = $data['mstlevel_code'];
$_SESSION['timeout'] = time()+1000; $_SESSION['login'] = 1; if($_SESSION['leveluser'] != 'LVL0000002') { //header('location: index.php'); echo"Login succesfully"; } /*else { header('location: index2.php'); } }*/ if($myQryInsUsr) { echo '
Thank You! Your regist has been created. Please wait we will send email for activation your account.
'; } } ?>
Form Registration
City...Banda AcehDenpasarSerangTangerangBengkuluGorontaloJakartaSungai PenuhJambiBandungBekasiBogorCimahiCirebonDepokSukabumiTasikmalayaBanjarMagelangPekalonganPurwokerto
Login Administrator
1 Jawaban:
di debug aja gan satu2, pas generate codenya. ada error atau engga.