handoyo
Members-
Posts
18 -
Joined
-
Last visited
Content Type
Forums
News
20th
EduGeek EDIT Conference
Blogs
Everything posted by handoyo
-
Thanks..I'll find it out..Again i want to ask,how should i handle the members folder??Is it better to put the members page within the main folder where i put the index file etc...Thanks..
-
I've abled to authenticate the members and redirect them to members/index.php ... It just that i'm curious about making the url become index.php?member=a which a was the member name..Thanks...
-
Hi all,i want to ask.I've created a folder for the members page..On my code,i redirect to localhost/rekan doa/member/index.php if the member suceeded to login..Is it possible to make the address become localhost/rekandoa/index.php?member=a instead of localhost/rekan doa/member/index.php?Please teach me and what should i learn..Thanks a lot...
-
Yes,it does.Paul,what do you do usually when dealing with member registration?Will you put the insert function within the registration page or you put the function in a another page?Thanks a lot..
-
Hi Paul,i've tried it.It displasy error says that undefined index..If i put the queries in the display_login_form(),it works,The database was updated.All i'm trying to do is to make another page that contains the queries function..Thanks a lot...
-
The echo works Pashers..But still can't get it working..
-
Hi cullingsh,the if($exec) doesn't get any problem if i put it in the output_fns.php.Maybe i have missed some statements there..Thanks..
-
Hi Pashers,i've tried it.No,it doesn't show up..Maybe there are something wrong with my code perhaps??Thanks...
-
Yes,i upload the files here.Rekan Doa.zip
-
Yes,should i send you the files perhaps??I've checked using phpmyadmin..No data's updated...Thanks..
-
I got no errors from mysql,it just the textfield values are still remain..Thanks...
-
I got no error ouput there,i've include the db connection file in the fns.inc.php..Suppose i do something wrong with calling the function?Thanks a lot...For the output_fns.php here are the full codes.. include('fns.inc.php'); //buat header function do_kepala($title){ ?> "http://www.w3.org/TR/html4/strict.dtd"> }; //buat body function do_body() { login_form(); ?> }; function do_footer() { ?> }; function display_login_form() { $Error = array("email" => "","pwd" =>"","pwd1"=>""); if(isset($_POST['submit'])) { $email=mysql_real_escape_string($_POST['email']); if(empty($email)){ $Error['email'] = "Email tidak boleh kosong"; } else if (!strchr($email, '@')) { $Error['email'] = "Email yang anda masukkan tidak valid"; } $pwd1=mysql_real_escape_string($_POST['pwd1']); if(empty($pwd1)) { $Error['pwd1'] = "Password 1 tidak boleh kosong"; } $pwd2=mysql_real_escape_string($_POST['pwd2']); if(empty($pwd2)) { $Error['pwd'] = "Password 2 tidak boleh kosong"; } else if($pwd1 != $pwd2) { $Error['pwd'] = "Password harus cocok"; } $nama=mysql_real_escape_string($_POST['nama']); $tmpt=mysql_real_escape_string($_POST['tempat_lahir']); $tgl=mysql_real_escape_string($_POST['tgl']); $bln=mysql_real_escape_string($_POST['bln']); $thn=mysql_real_escape_string($_POST['thn']); $tgl_lahir=$tgl.'-'.$bln.'-'.$thn; $jekel=mysql_real_escape_string($_POST['jekel']); $alamat=mysql_real_escape_string($_POST['alamat']); $kota=mysql_real_escape_string($_POST['kota']); $propinsi=mysql_real_escape_string($_POST['propinsi']); if(empty($Error)) { insert($email,$pwd,$nama,$tgl_lahir,$jekel,$tmpt,$alamat,$kota,$propinsi); } } else { $email=""; $pwd1=""; $pwd2=""; $nama=""; $tmpt=""; $tgl=""; $bln=""; $thn=""; $tgl_lahir=$tgl.'-'.$bln.'-'.$thn; $jekel=""; $alamat=""; $kota=""; $propinsi=""; } ?> Data keanggotaan Email anda Password 6-12 karakter Ulangi Password Data pribadi * Mohon diisi dengan data yang sebenarnya Nama lengkap anda * Mohon nama asli anda Tempat lahir anda * Tanggal lahir * dd/mm/yyyy 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 Jenis Kelamin Jenis kelamin anda Pilih salah satu... Pria Wanita Alamat Alamat lengkap anda Kota Kota anda Propinsi Propinsi anda Pilih salah satu.... Nanggroe Aceh Darussalam Sumatera Utara Sumatera Barat Bengkulu Riau Kepulauan Riau Jambi Sumatera Selatan Lampung Kepulauan Bangka Belitung DKI Jakarta Jawa Barat Banten Jawa Tengah DI Yogyakarta Jawa Timur Kalimantan Barat Kalimantan Tengah Kalimantan Selatan Kalimantan Timur Bali Nusa Tenggara Barat Nusa Tenggara Timur Sulawesi Barat Sulawesi Utara Sulawesi Tengah Sulawesi Selatan Sulawesi Tenggara Gorontalo Maluku Maluku Utara Papua Barat Papua Sign-up }; function doError( $field ) { if( isset($errors[$field]) ) { echo ''.$errors[$field].''; } ?> }; function login_form() { ?> Email anda Password Log In Register }; ?>
-
Hi all,i need help please..I got 2 php files,i'm intending to call a insert function from fns.inc.php to make a insert into myql database query..But it doesn't work..Here are the codes..Thanks a lot... output_fns.php function display_login_form() { $Error = array("email" => "","pwd" =>"","pwd1"=>""); if(isset($_POST['submit'])) { $email=mysql_real_escape_string($_POST['email']); if(empty($email)){ $Error['email'] = "Email tidak boleh kosong"; } else if (!strchr($email, '@')) { $Error['email'] = "Email yang anda masukkan tidak valid"; } $pwd1=mysql_real_escape_string($_POST['pwd1']); if(empty($pwd1)) { $Error['pwd1'] = "Password 1 tidak boleh kosong"; } $pwd2=mysql_real_escape_string($_POST['pwd2']); if(empty($pwd2)) { $Error['pwd'] = "Password 2 tidak boleh kosong"; } else if($pwd1 != $pwd2) { $Error['pwd'] = "Password harus cocok"; } $nama=mysql_real_escape_string($_POST['nama']); $tmpt=mysql_real_escape_string($_POST['tempat_lahir']); $tgl=mysql_real_escape_string($_POST['tgl']); $bln=mysql_real_escape_string($_POST['bln']); $thn=mysql_real_escape_string($_POST['thn']); $tgl_lahir=$tgl.'-'.$bln.'-'.$thn; $jekel=mysql_real_escape_string($_POST['jekel']); $alamat=mysql_real_escape_string($_POST['alamat']); $kota=mysql_real_escape_string($_POST['kota']); $propinsi=mysql_real_escape_string($_POST['propinsi']); if(empty($Error)) { //this is the function that i want to call insert($email,$pwd,$nama,$tgl_lahir,$jekel,$tmpt,$alamat,$kota,$propinsi); } } else { $email=""; $pwd1=""; $pwd2=""; $nama=""; $tmpt=""; $tgl=""; $bln=""; $thn=""; $tgl_lahir=$tgl.'-'.$bln.'-'.$thn; $jekel=""; $alamat=""; $kota=""; $propinsi=""; } ?> Data keanggotaan Email anda Password 6-12 karakter Ulangi Password Data pribadi * Mohon diisi dengan data yang sebenarnya Nama lengkap anda * Mohon nama asli anda Tempat lahir anda * Tanggal lahir * dd/mm/yyyy 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 Jenis Kelamin Jenis kelamin anda Pilih salah satu... Pria Wanita Alamat Alamat lengkap anda Kota Kota anda Propinsi Propinsi anda Pilih salah satu.... Nanggroe Aceh Darussalam Sumatera Utara Sumatera Barat Bengkulu Riau Kepulauan Riau Jambi Sumatera Selatan Lampung Kepulauan Bangka Belitung DKI Jakarta Jawa Barat Banten Jawa Tengah DI Yogyakarta Jawa Timur Kalimantan Barat Kalimantan Tengah Kalimantan Selatan Kalimantan Timur Bali Nusa Tenggara Barat Nusa Tenggara Timur Sulawesi Barat Sulawesi Utara Sulawesi Tengah Sulawesi Selatan Sulawesi Tenggara Gorontalo Maluku Maluku Utara Papua Barat Papua Sign-up fns.inc.php function insert($email,$pwd,$nama,$tgl_lahir,$jekel,$tmpt,$alamat,$kota,$propinsi) { $tambahuser="INSERT INTO `users` (`email`,`password`,`nama`,`tempat_lahir`, `tgl_lahir`,`jenis_kelamin`,`alamat`,`kota`,`propinsi`) VALUES ('$email','$pwd','$nama','$tmpt','$tgl_lahir','$jekel','$alamat','$kota','$propinsi');"; $exec=mysql_query($tambahuser); if ($exec) { header('location:thanks.php'); return mysql_affected_rows(); } else { echo mysql_error(); } } ?>
-
Thanks Dave,i got more knowledge here..Btw,that's ok Dave about your criticism..I learn how to post the way it should be so other people can understand what kind of help that i ask for.
-
Hi lightinthedark,i've followed as you says..On the register.php displays Notice: Undefined index: email in C:\wamp\www\Rekan Doa\reg.php on line 5 here are the codes that i modified.Did i made mistakes?Should it be display the register.php instead of reg.php when i click submit?By the way i include the files //Holds the function to be used for display the pages output_fns.php function do_kepala($title){ ?> "http://www.w3.org/TR/html4/strict.dtd"> <br /> .error {<br /> color: red;<br /> font-weight: bold;<br /> font-size: 0.9em;<br /> }<br /> }; function do_body() { ?> }; function do_footer() { ?> }; function display_login_form() { ?> Data keanggotaan Email anda Jadi login id anda Password 6-12 karakter Ulangi Password 6-12 karakter Data pribadi Nama Nama lengkap anda Tanggal lahir dd/mm/yyyy 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 2000 1999 1998 1997 1996 1995 1994 1993 1992 1991 1990 1989 1988 1987 1986 1985 1984 1983 1982 1981 1980 1979 1978 1977 1976 1975 1974 1973 1972 1971 1970 1969 1968 1967 1966 1965 1964 1963 1962 1961 1960 Jenis Kelamin Jenis kelamin anda Pilih salah satu... Laki-laki Perempuan Alamat Alamat lengkap anda Kota Kota anda Propinsi Propinsi anda Pilih salah satu.... Nanggroe Aceh Darussalam Sumatera Utara Sumatera Barat Bengkulu Riau Kepulauan Riau Jambi Sumatera Selatan Lampung Kepulauan Bangka Belitung DKI Jakarta Jawa Barat Banten Jawa Tengah DI Yogyakarta Jawa Timur Kalimantan Barat Kalimantan Tengah Kalimantan Selatan Kalimantan Timur Bali Nusa Tenggara Barat Nusa Tenggara Timur Sulawesi Barat Sulawesi Utara Sulawesi Tengah Sulawesi Selatan Sulawesi Tenggara Gorontalo Maluku Maluku Utara Papua Barat Papua Sign-up }; //the code that you gave me function doError( $field ) { if( isset($errors[$field]) ) { echo ''.$errors[$field].''; } }; ?> //Used to validate values and save to database reg.php include("db.inc.php"); $email=$_POST['email']; $pwd1=$_POST['pwd1']; $pwd2=$_POST['pwd2']; $tgl=$_POST['tgl']; $bln=$_POST['bln']; $thn=$_POST['thn']; $tgl_lahir=$tgl.'-'.$bln.'-'.$thn; $jekel=$_POST['jekel']; $alamat=$_POST['alamat']; $kota=$_POST['kota']; $propinsi=$_POST['propinsi']; //this one is from RabbieBurns $errors = array(); if( isset($_POST['submit'] )) { // check email $email = $_POST['email']; if (!strchr($email, '@')) { echo "Sorry, that isn't a valid email address."; } // check passwords $pwd1=$_POST['pwd1']; $pwd2=$_POST['pwd2']; if( $pwd1 == '' ) { $errors['pwd1l'] = 'First password field not filled in'; } if( $pwd2 == '' ) { $errors['pwd1l'] = 'Second password field not filled in'; } elseif( $pwd1 != $pwd2 ) { $pwd1 = ''; $pwd2 = ''; $errors['pwd2'] = 'Passwords do not match'; } // and so on and so on checking each field and setting appropriate error messages } ?> //display the registration form register.php include('output_fns.php'); include('reg.php'); do_kepala('Register'); do_body(); display_login_form(); ?> Rekan Doa.zip
-
Thanks a lot guys..I'll try to implement it and sorry if my posting is not the way it should be..What i'm trying to do is to validate the email field,etc.For example if the email field is left blank,then it will display errors...
-
Yes,i intending to validate emails,blank text input..How should i do it?Thanks..
-
Hi all,i need help with validating form..I got 3 php files.How do i show the error messages beside the text..Here are the codes output_fns.php function do_kepala($title){ ?> "http://www.w3.org/TR/html4/strict.dtd"> }; function do_body() { ?> }; function do_footer() { ?> tes 1234 }; function display_login_form() { ?> Data keanggotaan Email Become your id Password 6-12 karakter Ulangi Password 6-12 karakter Personal data Name Your full name Birthday date dd/mm/yyyy 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 2000 1999 1998 1997 1996 1995 1994 1993 1992 1991 1990 1989 1988 1987 1986 1985 1984 1983 1982 1981 1980 1979 1978 1977 1976 1975 1974 1973 1972 1971 1970 1969 1968 1967 1966 1965 1964 1963 1962 1961 1960 Sex Jenis kelamin anda Choose one... male female Address Your address Kota Town Propinsi Province Pilih salah satu.... Nanggroe Aceh Darussalam Sumatera Utara Sumatera Barat Bengkulu Riau Kepulauan Riau Jambi Sumatera Selatan Lampung Kepulauan Bangka Belitung DKI Jakarta Jawa Barat Banten Jawa Tengah DI Yogyakarta Jawa Timur Kalimantan Barat Kalimantan Tengah Kalimantan Selatan Kalimantan Timur Bali Nusa Tenggara Barat Nusa Tenggara Timur Sulawesi Barat Sulawesi Utara Sulawesi Tengah Sulawesi Selatan Sulawesi Tenggara Gorontalo Maluku Maluku Utara Papua Barat Papua Sign-up }; ?> reg.php $email=$_POST['email']; $pwd1=$_POST['pwd1']; $pwd2=$_POST['pwd2']; $tgl=$_POST['tgl']; $bln=$_POST['bln']; $thn=$_POST['thn']; $tgl_lahir=$tgl.'-'.$bln.'-'.$thn; $jekel=$_POST['jekel']; $alamat=$_POST['adrress']; $kota=$_POST['town']; $propinsi=$_POST['province']; ?> register.php include('output_fns.php'); do_kepala('Register'); do_body(); display_login_form(); ?>
