kula 0 Report post Posted January 30, 2008 ok thanks to null, and amin007 for helping.. by the way, rasenye ade yg tak tau lagi, tapi supervisor aku dah tuka rangka plan.. database kne stay Ms Access tapi programming still gne php.. so far, aku da dapat skit2 coding(tinggal 4 ari.. uwah.. takutnye..)masalah skang ni:1) Tak tau nape tapi ble je aku link form kata laluan(.htm) ke process_login(.php) akan jadik camnih..katalaluan.htm = click process_login.php = click run/save file = 2)ble tuka katalaluan(.php) dan click enter ke process_login(.php) kluar plak yang nih...katalaluan.php = process_login.php = anyone knows the solution? please help ASAP if u can.. thanks.. Quote Share this post Link to post Share on other sites
ejoe 0 Report post Posted January 31, 2008 php - apche idup ke tak ni? Quote Share this post Link to post Share on other sites
kula 0 Report post Posted February 2, 2008 php - apche idup ke tak ni?aku da on apache tapi tak on mysql... pasal aku tak gne mysql.. aku kne gne access.. tau tak nape? Quote Share this post Link to post Share on other sites
someone... 0 Report post Posted February 2, 2008 Could you give me full information about the system you being build with full of its coding. I think I can do it. Quote Share this post Link to post Share on other sites
amin007 1 Report post Posted February 2, 2008 c:\apache\htdocs\subplan\katalaluan.htmtu silap laakalau nak buka kena mcm nitaip urlhttp://localhost/subplan/katalaluan.htm tukar kepada index.htmtapi pastikan servis apache,php jalankalau tak memang tak jadiinternal server error Quote Share this post Link to post Share on other sites
mohdfadly 24 Report post Posted February 2, 2008 Betul tu. PHP macam tak jalan. Cuba check dulu PHP.Page katalaluan.htm jadi katalaluan.php tu biasa je, dalam apache kita boleh setkan extension .php run as .html. So, nampak macam php tapi sebenarnya bukan.Check dulu PHP.Kalau pakai Windows + Apache 2.2 + PHP 5, edit httpd.conf dan load module PHP.====================================LoadModule php5_module "C:/php5/php5apache2_2.dll"====================================Restart balik web server. Quote Share this post Link to post Share on other sites
kula 0 Report post Posted February 4, 2008 haha... btul la kate ko amin.. mmg salah kat url tu.. hm.. da ok da..so, progress aku camni skang:1) sabtu ngan ahad aritu aku jmpe lecturer.. tapi tak sangke lecturer aku pn pning tengok aku nyer projek..so die suggest aku wat gne asp.. kat asp ader connection wizard tuk database.. so lagi snang la nak buat tapiproblem die aku da try running still jadik cam problem kat post1.. da on apache, tukar url ke localhost pn same gak..so aku assume ni sbab software kurang or pasal engine asp tarak..2) so skang aku dalam dilema nih.. tak tau nak wat camne.. teruskan ngan projek yg sedia ade, tapi pnuh kekonfusandalam coding, or tukar gne asp plak.. nih sebaik aku nye spevisor bagi time lebih skit lagi.. adoi segan aku asik extend tarikh jer.. haha.. yang bawah ni la contoh connection wizard kt dreamweaver tuk asp.. mcam sng skit kn?3) leh tak bantu aku cadangkan mane satu langkah yg patut aku buat skang? asp or php?..._______________------------------------_____________@someone: thanks dude to check around.. anyway, my programs was an updated version of currently existed and used standalonesystems(this was completely Ms Access application environment).. so i was assign to update it to a web-based system, yet withAccess database(cauze my sperviso are old man and not willing to use modern style of MySQL.. "It's confusing me" <- that whathe said..) so, i've been wasting 1 month to just recreating the same interface(with a slight differ) using macromedia dreamweaver(<-also one of the requirement because the users are old folks whose cant tolerate with modern skill).. and another 1 month waste of time to just learning how to use php/mysql/phpmyadmin(he said he gonna try to use MySQL and agree when i said i want to use MySQL) to find out last week that he insist on using Ms Access because it is simpler(which i believe that he couldnt keep up with MySQL and just using some reason).. so now i hang up on doing ODBC connection.. whats worth is i cant find any tutorial online or offline on how to use odbc with php or even odbc list of command..so, whats stuck me now are all the odbc example turned out to not do well with the code syntax.. this below is the last code that i still used(others are dumped) and still turned out to not be very well..<?php// Connects to your Database $odbc = odbc_connect("SubPlan", "root", "") or die('Could not connect to Database'); //Checks if there is a login cookieif(isset($_COOKIE['SubPlan_Site']))//if there is, it logs you in and directes you to the members page{ $username = $_COOKIE['SubPlan_Site']; $pass = $_COOKIE['SubPlan_pass'];$check = odbc_exec($odbc, "SELECT * FROM login WHERE loginID = '$username'")or die(odbc_error());while($info = odbc_fetch_array($check)) {if ($pass != $info['katalaluan']) {echo "Wrong Password";}else{header("Location: Carian.php");}}}//if the login form is submittedif (isset($_POST['submit'])) { // if form has been submitted// makes sure they filled it inif(!$_POST['loginID'] | !$_POST['katalaluan']) {die('You did not fill in a required field.');}// checks it against the databaseif (!get_magic_quotes_gpc()) {$_POST['email'] = addslashes($_POST['email']);}$query = odbc_exec($odbc, "SELECT * FROM login WHERE loginID = '".$_POST['loginID']."'") or die (odbc_errormsg()); $check2 = odbc_num_rows($query);//Gives error if user dosen't existif ($check2 == 0) {die('That user does not exist in our database. <a href=process_daftar.php>Click Here to Register</a>');}while($info = odbc_fetch_array( $check )) {$_POST['katalaluan'] = stripslashes($_POST['katalaluan']);$info['katalaluan'] = stripslashes($info['katalaluan']);$_POST['katalaluan'] = md5($_POST['katalaluan']);//gives error if the password is wrongif ($_POST['katalaluan'] != $info['katalaluan']) {die('Incorrect password, please try again.');}else { // if login is ok then we add a cookie $_POST['username'] = stripslashes($_POST['loginID']); $hour = time() + 3600; setcookie(SubPlan_Site, $_POST['loginID'], $hour); setcookie(SubPlan_pass, $_POST['katalaluan'], $hour); //then redirect them to the members area header("Location: Carian.php"); } } } else { // if they are not logged in ?> <?phpheader("Location:katalaluan.htm");?><?php } ?>when i run the code, it becomes like this : i checked it and notice that the code (odbc_fetch_array) are unusable in php..and thats all i have been progressing so far.. still looking for appropriate code..for retrieving data/displaying data/register/add/delete and other code too.. and especially security coding.. so, anything u can help me? thanks in advance.. Quote Share this post Link to post Share on other sites
amin007 1 Report post Posted February 4, 2008 nak pakai asp???susah nak cakap laatapi kalau ko dah pakai dreamviver,php dah boleh seting secara wizard.kalau nak senang laahttp://www.amin007.org/fail//website/Kelas_PHP_MDB.zipcuba ko ambil scrip nikalau tak silap aku, scrip ni datangdalam buku.ko ada tak beli buku apa2 ker? Quote Share this post Link to post Share on other sites
kula 0 Report post Posted February 5, 2008 urm.. aku just ader buku manual php(dapat dari lecturer..) tapi nih gne mysql gak.. and ader vcd tutorial phpmyadmin tapi pun mysql gak.. hm.. tau tak kat ne nak dapat list2 code ntuk odbc connection? lagi satu, php connection wizard tu bukan tuk mysql je ke? da try da tadi.. Quote Share this post Link to post Share on other sites
kula 0 Report post Posted February 5, 2008 hello amin, hehe.. aku da try da care ko tu.. em, akhirnye pale otak aku da tak serabut sangat da.. camnih,aku gne model ko tuk wat connection, and pastu try edit process login aku jadik something like this <?phpinclude 'model_kelas_mdb.php';if (isset($_POST['submit'])){$loginID = $_POST['loginID'];$katalaluan = $_POST['katalaluan'];}$kelasMDB = new kelasMDB('SubPlan.mdb'); $kelasMDB->buka_Samb_Data();$kelasMDB->cetus_Samb_Data("select * from login where loginID = '".$loginID."'");while ( !$kelasMDB->tamat_Samb_Data() ){ echo "<b>".$kelasMDB->nilaiMedanMDB('loginID')."</b>"; echo " "; echo "<b>".$kelasMDB->nilaiMedanMDB('katalaluan')."</b>"; echo '<br>'; $kelasMDB->data_seterusnya();}$kelasMDB->tutup_Samb_Data(); ?>which gives output like this.. (yay, its work...!!!^^)and the slackthings is, in the query i put condition 'where' sbab tu tarak rekod selepastu... tapi yg paling penting skali, coding ni dah menunjukkan data dari $_POST <- dapat dari login page (katalaluan.htm) pas ke process_login.php.. hehehe... so ble da buang condition where tu sumer name2 user da kuar..so skang nih, aku nk tanye skit la, kan ke odbc_fetch_array tu da digantikan dengan yang ni ke?$this->setRekod = $this->data_ADODB->execute( $strSQL );sbab kat process login ni aku nak letak satu coding yang leh check loginname dan password yg lbih kurang cam nih... $query = odbc_exec($odbc, "SELECT * FROM login WHERE loginID = '".$_POST['loginID]."'") or die (odbc_errormsg()); $check2 = odbc_num_rows($query);while($info = odbc_fetch_array( $check )) {$_POST['katalaluan'] = stripslashes($_POST['katalaluan']);$info['katalaluan'] = stripslashes($info['katalaluan']);$_POST['katalaluan'] = md5($_POST['katalaluan']);if ($_POST['katalaluan'] != $info['katalaluan']) {die('Incorrect password, please try again.');}stakat ni ak try tk jadik lagi.. last skali kode die aku da wat camni... masalah die yg nih looping endlessly, pastu terbalik plak.. kalo pengguna tu ade dalam db, baru die loop echo "Data pengguna ".$_POST['loginID]." tiada dalam senarai. sila register."; kalo pengguna takde dalam db, die just kuar page processlogin.php tapi blank page.. yg sblom2 nih sampai tak compare data lgsg terus execute comand redirect page je.. yg ni kode yg last tu..<?phpinclude 'model_kelas_mdb.php';if (isset($_POST['submit'])){$loginID = $_POST['loginID'];$katalaluan = $_POST['katalaluan'];}$kelasMDB = new kelasMDB('SubPlan.mdb'); $kelasMDB->buka_Samb_Data();$kelasMDB->cetus_Samb_Data("select * from login where loginID=".$loginID."'");while ( !$kelasMDB->tamat_Samb_Data() ){ if ($loginID>0) header("Location:process_pwd.php"); else echo "Data pengguna ".$_POST['loginID]." tiada dalam senarai. sila register.";}$kelasMDB->tutup_Samb_Data(); ?>aku ingat nak wat satu restricted page yang khas tuk execute list name2 user and password ble user press enter kat loginpage pastu wat codin kt processlogin yg compare kn terus ngan page2 tu je.. tapi lebih kurang same gak ngan yg skarang ni kn? hadoih... naik segan da aku asik2 salah jer... nak tanye kat ko ni smpai da tebal muke ak da.. sebaik ak tngah blaja lg, kalo da grade pn camni halamak.. malu siot.. hehe.. Quote Share this post Link to post Share on other sites
amin007 1 Report post Posted February 6, 2008 http://phplens.com/lens/adodb/tute.htmhttp://phplens.com/lens/adodb/tips_portable_sql.htmharap dapat membantu Quote Share this post Link to post Share on other sites
kula 0 Report post Posted February 13, 2008 thanks amin.. wat mase nih aku ngah try upgrade version php je.. sbab forum kat tizag.com ckap version < 4.1 tak suport odbc fetch array.. nnti kalo da ad progres aku report kt ko eh.. hehe Quote Share this post Link to post Share on other sites