Forum Sementara Putera.com

Bersama kita perkemaskan forum ini sementara forum asal dalam pemulihan.

Forum putera dah kembali. Masalah sudah berjaya diselesaikan. Sila lawati http://forum.putera.com/tanya


    Pertolongan Ikhlas Ajar Bina Laman Web

    Share

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Mon Dec 21, 2009 2:26 pm

    salam.....sy skrg sdg pratikal, sy diwajibkn membuat satu web utk cmpny, sy dah porpose tjuk iaitu staf profile, mslhnye skrg ilmu bljar xbape byk nk wat web nie n sy nie agk lmbt ckit nk fhm coding...sy dah cube kol org nk mntk tlg,ade yg ckp bz n ade yg nk kne kn duit, mslhnye sy skrg xde gaji n elaun kje kt cmpny nie...harap la ade insan yg baik n berhati mulia yg leh tlg sy..sy btl2 nk bljar .....tq Very Happy

    /* tolong guna perkataan yang lengkap. Kurangkan bahasa SMS. Thanks */
    /* ongbok */

    TJ-Ariff
    Supervisor
    Supervisor

    Gender : Male Number of posts : 473
    Age : 96
    Location : D'Royal City Of Silver
    Job/hobbies : IT / membaca / Santai
    Registration date : 17/02/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by TJ-Ariff on Mon Dec 21, 2009 3:06 pm

    nak senang guna MS-FrontPage


    --------------------------------------------

    I'm A Big Big Man, In A Big Big World, It's Not A Big Big Thing, If You Leave Me.
    When GOD Opened the window of mercy,HE asked me; What is your wish for to day?, I said; Allah, Please take care of that person who is reading this message.

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Mon Dec 21, 2009 3:31 pm

    MS-FrontPage???.....lect sy nk dlm php mysql n dreamweaver la...sy tersilap post kt cni la

    LanoG
    Moderators
    Moderators

    Gender : Male Number of posts : 537
    Location : Petaling Jaya
    Job/hobbies : Basuh Pinggan
    Registration date : 04/05/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by LanoG on Mon Dec 21, 2009 3:52 pm

    Topik dipindahkan ke Bahagian Pembangunan Laman Sesawang.


    --------------------------------------------
    www.lanogame.co.cc

    OngBok
    Moderators
    Moderators

    Gender : Male Number of posts : 729
    Location : Dungun Terengganu
    Job/hobbies : Pesara JKR
    Registration date : 18/02/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by OngBok on Tue Dec 22, 2009 2:35 am

    kalau nak buat dalam dreamweaver, kena install dulu dreamweaver.
    awak nak guna dreaweaver ver berapa? Cerita sikit awak dah mula dah ker....,
    sampai kat mana dah sekrang nie... kalau belum buat apa2 lagi,

    1. install Xampp WebServer
    Download Panduan Install Xampp & Dreamweaver


    2. install Dreamweaver (any version)


    satu lagi kalau boleh jangan guna perkataan ringkas. susah nak baca.
    takut nanti orang lari. tengok pakcik taip perkataan penuh. :afro

    ok.


    --------------------------------------------
    =====================================================
    http://www.photoshopessentials.com/
    http://www.megaleech.eu/index.php
    https://connectnow.acrobat.com/oxxxo2009

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Tue Dec 22, 2009 8:28 am

    OngBok wrote:kalau nak buat dalam dreamweaver, kena install dulu dreamweaver.
    awak nak guna dreaweaver ver berapa? Cerita sikit awak dah mula dah ker....,
    sampai kat mana dah sekrang nie... kalau belum buat apa2 lagi,

    1. install Xampp WebServer
    Download Panduan Install Xampp & Dreamweaver


    2. install Dreamweaver (any version)


    satu lagi kalau boleh jangan guna perkataan ringkas. susah nak baca.
    takut nanti orang lari. tengok pakcik taip perkataan penuh. :afro

    ok.


    tq la awk, sy dah install xampp dan dreamweaver, sekarang tengah buat register staff, masalah pada started work , sy nk buat tarikh dalam code php , dah cri tp still xdapt, yang dapat pn calendar dan time je

    johnburn
    Moderators
    Moderators

    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by johnburn on Tue Dec 22, 2009 9:15 am

    syira86 wrote:
    tq la awk, sy dah install xampp dan dreamweaver, sekarang tengah buat register staff, masalah pada started work , sy nk buat tarikh dalam code php , dah cri tp still xdapt, yang dapat pn calendar dan time je

    bleh terngkan ngan detail skit lg x nk tarikh cmne? tarikh ni nk user yg mskkn ke cmne? kl bleh, tnjuk code yg dh ade.
    dlu mase sy mule2 blaja php, sy ade pkai buku How to Do Everything with PHP & MYSQL. Buku tu snang untk difahami untk newbie cam sy ni. maklumlah blaja sndri. site buku tu pn ade gak tutorial yg mudh untk difahami. bleh rjuk sini:
    http://www.everythingphpmysql.com/cases/index.html


    --------------------------------------------

    tahukah kamu saat kamu menangis
    adalah air mata ku yang jatuh berlinang
    tahukah kamu saat kamu tersakiti
    adalah aku yang pertama terluka
    Jangan Klik

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Tue Dec 22, 2009 9:41 am

    nk buat mcm nie started
    Code:
    year of started work:
    day
    <label>
      <select name="select" id="select">
      </select>
    </label>
    month
    <label>
      <select name="select2" id="select2">
      </select>
    </label>
    year
    <label>
      <select name="select3" id="select3">
      </select>
    </label>
    </body>

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Tue Dec 22, 2009 9:45 am

    saya ade mslah dalam register staff dan login staff...sy letakan login dan register staff code

    reg.php
    Code:


    <?php
          //add process
          if(isset($_POST["submit"])){
             mysql_query("INSERT INTO staff
             (idstaf,username,password,name,age,position,dept,gender,add,telo,telhp,fax_num,email,pic)
             
             VALUES (
                   '".$_POST["idstaf"]."',
                   '".$_POST["username"]."',
                   '".$_POST["password"]."',
                   '".$_POST["name"]."',
                   '".$_POST["age"]."',
                   '".$_POST["position"]."',
                   '".$_POST["dept"]."',
                   '".$_POST["gender"]."',
                   '".$_POST["telo"]."',
                   '".$_POST["telhp"]."',
                   '".$_POST["fax_num"]."',
                   '".$_POST["email"]."',
                   '".$_POST["pic"]."'
                   
                   )");
             
             //redirect page to cat list
             print "<meta http-equiv='refresh' content='1;URL=?page=home'>";

             print "<tr>
                 <td align='center' bgcolor='#99CC33'><strong><h1>Add Data Successfull</h1></strong></td>
               </tr><br />";
          }
       
       ?>



    <tr bgcolor="#FFCCCC"> 
    <form action='' method='post'  name='borang'>
        <table width="100%" border="0" cellspacing="2">
          <tr bgcolor="#FFCCCC">
            <td colspan="2" align="center"><strong>User Information</strong></td>
          </tr>
          <tr>
            <td width="22%" align="left"><div align="center">Staff Id</div></td>
            <td width="78%"><label>
              <input type="text" name="text" id="idstaf">
            </label></td>
          </tr>
          <tr>
            <td align="left"><div align="center">Username:</div></td>
            <td><span id="sprytextfield1">
              <input name='username' type='text' size='40' id="username" />
            </span></td>
          </tr>
          <tr>
            <td align="left"><div align="center">Password</div></td>
            <td><input name='password' type='password' id="password" size='40' /></td>
          </tr>
          <tr>
            <td align="left"><div align="center">Name:</div></td>
            <td><input name='name' type='text' size='40' id="name" /></td>
          </tr>
          <tr>
            <td align="left"><div align="center">Age:</div></td>
            <td><label>
              <input type="age" name="text" id="age">
            </label></td>
          </tr>
          <tr>
            <td align="left"><div align="center">Position:</div></td>
            <td><label>
              <input type="position" name="text" id="position">
            </label></td>
          </tr>
          <tr>
            <td align="left"><div align="center">Department:</div></td>
            <td><label>
              <input type="dept" name="text" id="dept">
            </label></td>
          </tr>
          <tr align="center">
            <td>Gender</td>
            <td align="left"><label>
              <input name="gender" type="radio" id="gender" value="radio">
            Male
            <input type="radio" name="gender" id="gender" value="radio2">
            Female</label></td>
          </tr>
          <tr align="center">
            <td>Address</td>
            <td align="left"><textarea name="add" cols="35" id="add"></textarea></td>
          </tr>
          <tr align="center">
            <td>Tel Office:</td>
            <td align="left"><input name='tel' type='text' size='40' id="telo" /></td>
          </tr>
          <tr align="center">
            <td>Tel hp:</td>
            <td align="left"><input name='telhp' type'text' size'40' id "telhp"/></td>
          </tr>
          <tr align="center">
            <td>Fax:</td>
            <td align="left"><input name='com_fax' type='text' size='40' id="com_fax" />
            <input name="pic" type="hidden" id="pic" value="nophoto.gif" size="60" /></td>
          </tr>
          <tr align="center">
            <td>Email:</td>
            <td align="left"><input name='email' type='text' id="email" size='40' /></td>
          </tr>
          <tr align="center">
            <td>&nbsp;</td>
            <td align="left"><input type="reset" name="Reset" id="button3" value="Reset" />
            <input name='submit' type='submit' id="submit" value='Register' /></td>
          </tr>
        </table>
    </form>
        </td>
      </tr>
    </table></td>
          </tr>
        </table></td>
      </tr>
      <tr valign="middle">
        <td>&nbsp;</td>
      </tr>
    </table>

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Tue Dec 22, 2009 9:46 am

    home.php

    Code:


    <?
    include config.php
    ?>
    <?php if($ses_cat != 0){
     $q1 = mysql_query("SELECT * from staff");
          
          while ($r1 = mysql_fetch_array($q1)){
          if ($r1["username"] == $ses_name) 
             {
                $name          = $r1["name"];
                  }   
              }
          ?>
     
    <img src="images/ciboy10.png" width="50" height="50"> <h1 class="style3">Welcome back <?php echo $name;?></h1>
    <?php } ?>
    <?php if($ses_cat == 0){?>
    <h1 class="style3">Welcome to our site</h1>
    <?php } ?>

    <?php
          if(isset($_POST["Submit"])){
          $matrix = $_POST["username"];
          $pass = $_POST["password"];

                
          $query = "SELECT * FROM staff WHERE username='".$matrix."' AND password='".$password."'";
          $result = mysql_query($query);
          
          if (!$result || mysql_num_rows($result) < 1) {
                   print "<meta http-equiv='refresh' content='1;URL=?'>";
                   print" Please try again";
             }
             else{
                while($row=mysql_fetch_array($result)){
                   $user_name = $row["username"];
                   
                }
                $query = "UPDATE sessionstaff SET ses_name='".$user_name."', ses_cat='1' WHERE ses_id='".$sid."'";
                mysql_query($query);
                print "<meta http-equiv='refresh' content='3;URL=?'>";print "<align=right><font color='green'> You now login</font>";
             }
          }
          
          //jika member
          if($ses_cat == 0){
          
      print"  <td><table width = '50px' height='29px' border = '10px'>
          <form id='form1' name='form1' method='post' action=''>
            <tr> </tr>
            <tr>
              <td>User ID</span>
                </td>
              <td>
                  <input type='text' name='username' id='username' /> 
            </td>
            </tr>
            <tr>
              <td>Password
                </td>
              <td>
                  <input type='password' name='password' id='password' />
              </td>
            </tr>
            <tr>
              <td><li><a href=?page=reg class='style2'>Sign up</a></li></td>
              <td><input type='submit' name='Submit' value='Login' /></td>
            </tr>
            <tr>
              <td colspan='2'>";
           
            print"</td>
            </tr>
          </form>
        </table>";
       
       }
       ?>

    johnburn
    Moderators
    Moderators

    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by johnburn on Tue Dec 22, 2009 10:07 am

    nk buat dropdown ek? rasenye untk day tu buat input biasa xyah dropdown pn xpe kot.


    --------------------------------------------

    tahukah kamu saat kamu menangis
    adalah air mata ku yang jatuh berlinang
    tahukah kamu saat kamu tersakiti
    adalah aku yang pertama terluka
    Jangan Klik

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Tue Dec 22, 2009 10:16 am

    betol juga kn....lagi senang buat mcm 2...cume masalah kat register ....coding ini ambil kat budak sem lepas punya...macam sama je tp ade error pulak....xfaham sangat coding die

    OngBok
    Moderators
    Moderators

    Gender : Male Number of posts : 729
    Location : Dungun Terengganu
    Job/hobbies : Pesara JKR
    Registration date : 18/02/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by OngBok on Tue Dec 22, 2009 10:21 am

    macam nie, cuba buat satu-satu.

    1. Cuba buat 1 form yang lengkap untuk staff reg.
    simpan fail dalam html/php

    2. Maklumat dari form tu nak simpan dalam database kan.
    bina dulu database/table untuk simpan rekod staff.

    3. Cuba test form samada masuk atau tidak dalam DB.

    4. Bila dah masuk dalam DB, cuba plak display data dari DB

    OK


    --------------------------------------------
    =====================================================
    http://www.photoshopessentials.com/
    http://www.megaleech.eu/index.php
    https://connectnow.acrobat.com/oxxxo2009

    johnburn
    Moderators
    Moderators

    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by johnburn on Tue Dec 22, 2009 12:07 pm

    syira86 wrote:betol juga kn....lagi senang buat mcm 2...cume masalah kat register ....coding ini ambil kat budak sem lepas punya...macam sama je tp ade error pulak....xfaham sangat coding die
    xpham skit, yg date started tu nk masukkan kedalam reg.php gak ek?
    sbb skang xde lg dlm tu. kl nk masukkan dalam reg.php gak, untuk generate dropdown untuk year, bleh pkai kod ni:
    Code:

    <select name="year">
    <?php
       echo "<option selected value=''>Year</option>";
       for ($i=date("Y")-30; $i<=date("Y"); $i++) {
          echo "<option value='$i'>$i</option>\n";
       }
    ?>

    </select>

    Kod tu akan generate dropdown menu untuk year dari tahun sekarang hingga 30 tahun sebelumnya. Bleh ubah looping tu kl nk. Untuk day tu pkai input box biasa sahaja dan untuk month bleh buat dropdown cam biasa.

    Satu sy perasan yang boleh mnyebabkan error, kl tgk reg.php tu, awk banyak silap input box die. Contoh:
    Code:
    <input type="text" name="text" id="idstaf">

    Kalau tgk kod tu, name untuk input box tu adalah text tp awk cuba ambik post data dari idstaf:
    Code:
    $_POST["idstaf"]

    So sepatutnya untuk input box tu kne camni:
    Code:
    <input type="text" name="idstaf" id="idstaf">

    Cek balik semua input box dia. Awk byk tertukar attribute type ngan name dan ni mnyebabkan php xdpt ambk data dari form. Sila rjuk w3c kl xpham penggunaan form or len2. Untuk input box leh rjuk sini:
    http://www.w3schools.com/TAGS/tag_input.asp


    --------------------------------------------

    tahukah kamu saat kamu menangis
    adalah air mata ku yang jatuh berlinang
    tahukah kamu saat kamu tersakiti
    adalah aku yang pertama terluka
    Jangan Klik

    johnburn
    Moderators
    Moderators

    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by johnburn on Tue Dec 22, 2009 1:02 pm

    Btw, sistem ni untuk kegunaan syarkt kn? So dr segi security kne jage. At least kne buat validation untuk user input dan sanitize semua data.


    --------------------------------------------

    tahukah kamu saat kamu menangis
    adalah air mata ku yang jatuh berlinang
    tahukah kamu saat kamu tersakiti
    adalah aku yang pertama terluka
    Jangan Klik

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Tue Dec 22, 2009 1:20 pm

    utk department compny je...sy just buat profile staff, permohonan cuti dan pengumuman.itu je la .semua staf department kene register.staf boleh edit profile bila dah daftar.web nie ada 3 user iaitu admin,staff dan manager. fungsi manager sama macam staf cume dia ade kuasa nk reject/approved cuti perkeja...tugas admin add/delete/edit utk pegumuman..dan boleh search pengumuman yang dah add.admin juga boleh tgok list staff profile dan leave yang reject/approved.tq ye john

    johnburn
    Moderators
    Moderators

    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by johnburn on Tue Dec 22, 2009 1:39 pm

    no hal kl ade xpham bleh tnye lg sini


    --------------------------------------------

    tahukah kamu saat kamu menangis
    adalah air mata ku yang jatuh berlinang
    tahukah kamu saat kamu tersakiti
    adalah aku yang pertama terluka
    Jangan Klik

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Tue Dec 22, 2009 2:05 pm

    page reg.php jadi error mcm nie la...sy dah tkr text yg john ckp 2 tp tak tau knape kuar error macm itu

    johnburn
    Moderators
    Moderators

    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by johnburn on Tue Dec 22, 2009 2:12 pm

    Cek mysql kat xampp samaada dh running atau blom. kl dh, paste kod config.php sini.


    --------------------------------------------

    tahukah kamu saat kamu menangis
    adalah air mata ku yang jatuh berlinang
    tahukah kamu saat kamu tersakiti
    adalah aku yang pertama terluka
    Jangan Klik

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Tue Dec 22, 2009 2:44 pm

    saya dah tgok mysql dan xampp...dia tgah run
    Code:

    <?php

          //connect to database
          mysql_connect("localhost","root","")
          or die("not Connect");
          
          //select database
          mysql_select_db("ccss")
          or die("cannot reached database");
          
          
          ?>

    johnburn
    Moderators
    Moderators

    Gender : Male Number of posts : 755
    Location : Terengganu
    Registration date : 07/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by johnburn on Tue Dec 22, 2009 3:02 pm

    hmm pelik. kod tu xde prob dh. error tu bese akan keluar kl user yg kite specified dlm connection tu xde. nt sy try tgk blk


    --------------------------------------------

    tahukah kamu saat kamu menangis
    adalah air mata ku yang jatuh berlinang
    tahukah kamu saat kamu tersakiti
    adalah aku yang pertama terluka
    Jangan Klik

    pampersDry
    Ahli Baharu
    Ahli Baharu

    Gender : Male Number of posts : 118
    Registration date : 13/02/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by pampersDry on Tue Dec 22, 2009 10:26 pm

    try paste code reg.php 2 tngok.....database da set pass x?... Very Happy

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Mon Dec 28, 2009 9:13 am

    sy stil xdpt buat register itu, tak tau la knape tak boleh buat....ini coding sy buat lain untuk register tapi still xdapat register...

    Code:




    <?php
          //add process
          if(isset($_POST["submit"])){
             mysql_query("INSERT INTO staff
             (id_staff,username,password,name,age,gender,birth,position,dept,add,tel_of,tel_hp,email,fax_num,pic)
             
             VALUES (
                   '".$_POST["id_staff"]."',
                   '".$_POST["username"]."',
                   '".$_POST["password"]."',
                   '".$_POST["name"]."',
                   '".$_POST["password"]."',
                   '".$_POST["age"]."',
                   '".$_POST["gender"]."',
                   '".$_POST["birth"]."',
                   '".$_POST["position"]."',
                   '".$_POST["dept"]."',
                   '".$_POST["add"]."',
                   '".$_POST["tel_of"]."',
                   '".$_POST["tel_hp"]."',
                   '".$_POST["email"]."',
                   '".$_POST["fax_num"]."',
                   '".$_POST["pic"]."',
                   
                   )");
             
             //redirect page to cat list
             print "<meta http-equiv='refresh' content='1;URL=?page=home'>";

             print "<tr>
                 <td align='center' bgcolor='#99CC33'><strong><h1>Add Data Successfull</h1></strong></td>
               </tr><br />";
          }
       
       ?>



    <form name='borang' method='post' action=''>

    <table width="100%" border="0" cellpadding="0" cellspacing="2">
      <tr><tr bgcolor="#FFCCCC">
             <td colspan="2" align="center"><strong>Staff Information</strong></td>
            </tr>
      <tr>
        <td width="123">Staff Id:</td>
        <td width="357"><input type="text" name="id_staff" id="id_staff"></td>
      </tr>
      <tr>
        <td>Username:</td>
        <td>
          <input name="username" type="text" id="username" size="40">
        </td>
      </tr>
      <tr>
        <td>Password:</td>
        <td>
          <input type="password" name="password" id="password">
        </td>
      </tr>
      <tr>
        <td>Name:</td>
        <td>
          <input name="name" type="text" id="name" size="40">
        </td>
      </tr>
      <tr>
        <td>Age:</td>
        <td>
          <input name="age" type="text" id="age" size="8">
        </td>
      </tr>
      <tr>
        <td>Gender:</td>
        <td>
          <input type="radio" name="gender" id="gender" value="radio">
        Male
        <input type="radio" name="gender" id="gender" value="radio2">
        Female</td>
      </tr>
      <tr>
        <td>Birth of Date:</td>
        <td>
          <input type="text" name="birth" id="birth">
        (dd/mm/yyyy)</td>
      </tr>
      <tr>
        <td>Position:</td>
        <td>
          <input name="position" type="text" id="position" size="40">
        </td>
      </tr>
      <tr>
        <td>Department:</td>
        <td>
          <input name="dept" type="text" id="dept" size="40">
        </td>
      </tr>
      <tr>
        <td height="69">Address</td>
        <td>
          <textarea name="add" id="add" cols="45" rows="5"></textarea>
        </td>
      </tr>
      <tr>
        <td>Tel Office:</td>
        <td>
          <input type="text" name="tel_of" id="tel_of">
        </td>
      </tr>
      <tr>
        <td>Tel Hp:</td>
        <td>
          <input type="text" name="tel_hp" id="tel_hp">
        </td>
      </tr>
      <tr>
        <td>Email:</td>
        <td>
          <input name="email" type="text" id="email" size="40">
        </td>
      </tr>
      <tr>
        <td>Fax_num:</td>
        <td>
          <input type="text" name="fax_num" id="fax_num">
        </td>
      </tr>
      <tr>
        <td>Pic:</td>
        <td>
          <input type="file" name="pic" id="pic">
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>
          <input type="reset" name="Reset" id="button" value="Reset">
          <input type="submit" name="button2" id="button2" value="Submit">
        </td>
      </tr>
    </table>
    </form>

     </tr>
    </table></td>
          </tr>
        </table></td>
      </tr>
      <tr valign="middle">
        <td>&nbsp;</td>
      </tr>
    </table>

    syira86
    Ahli Baharu
    Ahli Baharu

    Gender : Female Number of posts : 108
    Age : 30
    Location : kedah
    Job/hobbies : explore
    Registration date : 04/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by syira86 on Mon Dec 28, 2009 9:17 am

    ini sy punye staff database

    Code:


    -- phpMyAdmin SQL Dump
    -- version 3.2.0.1
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Dec 28, 2009 at 01:16 AM
    -- Server version: 5.1.37
    -- PHP Version: 5.3.0

    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

    --
    -- Database: `e-staff`
    --

    -- --------------------------------------------------------

    --
    -- Table structure for table `staff`
    --

    CREATE TABLE IF NOT EXISTS `staff` (
      `id_staff` int(10) NOT NULL AUTO_INCREMENT,
      `username` varchar(50) NOT NULL,
      `password` varchar(100) NOT NULL,
      `name` varchar(200) NOT NULL,
      `age` varchar(20) NOT NULL,
      `gender` varchar(100) NOT NULL,
      `birth` varchar(200) NOT NULL,
      `position` varchar(225) NOT NULL,
      `dept` varchar(225) NOT NULL,
      `add` varchar(255) NOT NULL,
      `tel_of` varchar(24) NOT NULL,
      `tel_hp` varchar(100) NOT NULL,
      `email` varchar(255) NOT NULL,
      `fax_num` varchar(30) NOT NULL,
      `pic` varchar(255) NOT NULL,
      PRIMARY KEY (`id_staff`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

    --
    -- Dumping data for table `staff`
    --


    xenomorf
    Ahli Baharu
    Ahli Baharu

    Number of posts : 239
    Location : BehinD ThE WaLL
    Registration date : 26/03/2009

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by xenomorf on Fri Jan 01, 2010 8:30 am

    code ni >>
    Code:

    <?php

          //connect to database
          mysql_connect("localhost","root","")
          or die("not Connect");
         
          //select database
          mysql_select_db("ccss")
          or die("cannot reached database");
         
         
          ?>

    dgn code ni >>

    Code:

    <?php
          //add process
          if(isset($_POST["submit"])){
            mysql_query("INSERT INTO staff
            (id_staff,username,password,name,age,gender,birth,position,dept,add,tel_of,tel_hp,email,fax_num,pic)
           
            VALUES (
                  '".$_POST["id_staff"]."',
                  '".$_POST["username"]."',
                  '".$_POST["password"]."',
                  '".$_POST["name"]."',
                  '".$_POST["password"]."',
                  '".$_POST["age"]."',
                  '".$_POST["gender"]."',
                  '".$_POST["birth"]."',
                  '".$_POST["position"]."',
                  '".$_POST["dept"]."',
                  '".$_POST["add"]."',
                  '".$_POST["tel_of"]."',
                  '".$_POST["tel_hp"]."',
                  '".$_POST["email"]."',
                  '".$_POST["fax_num"]."',
                  '".$_POST["pic"]."',
                 
                  )");
           
            //redirect page to cat list
            print "<meta http-equiv='refresh' content='1;URL=?page=home'>";

            print "<tr>
                <td align='center' bgcolor='#99CC33'><strong><h1>Add Data Successfull</h1></strong></td>
              </tr><br />";
          }
     
      ?>



    <form name='borang' method='post' action=''>

    <table width="100%" border="0" cellpadding="0" cellspacing="2">
      <tr><tr bgcolor="#FFCCCC">
            <td colspan="2" align="center"><strong>Staff Information</strong></td>
            </tr>
      <tr>
        <td width="123">Staff Id:</td>
        <td width="357"><input type="text" name="id_staff" id="id_staff"></td>
      </tr>
      <tr>
        <td>Username:</td>
        <td>
          <input name="username" type="text" id="username" size="40">
        </td>
      </tr>
      <tr>
        <td>Password:</td>
        <td>
          <input type="password" name="password" id="password">
        </td>
      </tr>
      <tr>
        <td>Name:</td>
        <td>
          <input name="name" type="text" id="name" size="40">
        </td>
      </tr>
      <tr>
        <td>Age:</td>
        <td>
          <input name="age" type="text" id="age" size="8">
        </td>
      </tr>
      <tr>
        <td>Gender:</td>
        <td>
          <input type="radio" name="gender" id="gender" value="radio">
        Male
        <input type="radio" name="gender" id="gender" value="radio2">
        Female</td>
      </tr>
      <tr>
        <td>Birth of Date:</td>
        <td>
          <input type="text" name="birth" id="birth">
        (dd/mm/yyyy)</td>
      </tr>
      <tr>
        <td>Position:</td>
        <td>
          <input name="position" type="text" id="position" size="40">
        </td>
      </tr>
      <tr>
        <td>Department:</td>
        <td>
          <input name="dept" type="text" id="dept" size="40">
        </td>
      </tr>
      <tr>
        <td height="69">Address</td>
        <td>
          <textarea name="add" id="add" cols="45" rows="5"></textarea>
        </td>
      </tr>
      <tr>
        <td>Tel Office:</td>
        <td>
          <input type="text" name="tel_of" id="tel_of">
        </td>
      </tr>
      <tr>
        <td>Tel Hp:</td>
        <td>
          <input type="text" name="tel_hp" id="tel_hp">
        </td>
      </tr>
      <tr>
        <td>Email:</td>
        <td>
          <input name="email" type="text" id="email" size="40">
        </td>
      </tr>
      <tr>
        <td>Fax_num:</td>
        <td>
          <input type="text" name="fax_num" id="fax_num">
        </td>
      </tr>
      <tr>
        <td>Pic:</td>
        <td>
          <input type="file" name="pic" id="pic">
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>
          <input type="reset" name="Reset" id="button" value="Reset">
          <input type="submit" name="button2" id="button2" value="Submit">
        </td>
      </tr>
    </table>
    </form>

     </tr>
    </table></td>
          </tr>
        </table></td>
      </tr>
      <tr valign="middle">
        <td>&nbsp;</td>
      </tr>
    </table>

    bersambung dalam satu page php tu ke?

    klu bukan dlm satu php tp dlm page lain, ko x include page connection (code paling atas) tu.

    so, klu yg ni code db.php
    Code:

    <?php
    //a little tweak
    $conn = "localhost";
    $user = " root";
    $pass = "";

          //connect to database
          mysql_connect($conn,$user,$pass)
          or die("not Connect");
         
          //select database
          mysql_select_db("ccss")
          or die("cannot reached database");
         
         
          ?>

    so dlm reg.php tu ko include db.php tu >>

    Code:

    <?php
    include ("db.php"); // include() db.php

          //add process
          if(isset($_POST["submit"])){
            mysql_query("INSERT INTO staff
            (id_staff,username,password,name,age,gender,birth,position,dept,add,tel_of,tel_hp,email,fax_num,pic)
           
            VALUES (
                  '".$_POST["id_staff"]."',
                  '".$_POST["username"]."',
                  '".$_POST["password"]."',
                  '".$_POST["name"]."',
                  '".$_POST["password"]."',
                  '".$_POST["age"]."',
                  '".$_POST["gender"]."',
                  '".$_POST["birth"]."',
                  '".$_POST["position"]."',
                  '".$_POST["dept"]."',
                  '".$_POST["add"]."',
                  '".$_POST["tel_of"]."',
                  '".$_POST["tel_hp"]."',
                  '".$_POST["email"]."',
                  '".$_POST["fax_num"]."',
                  '".$_POST["pic"]."',
                 
                  )");
           
            //redirect page to cat list
            print "<meta http-equiv='refresh' content='1;URL=?page=home'>";

            print "<tr>
                <td align='center' bgcolor='#99CC33'><strong><h1>Add Data Successfull</h1></strong></td>
              </tr><br />";
          }
     
      ?>



    <form name='borang' method='post' action=''>

    <table width="100%" border="0" cellpadding="0" cellspacing="2">
      <tr><tr bgcolor="#FFCCCC">
            <td colspan="2" align="center"><strong>Staff Information</strong></td>
            </tr>
      <tr>
        <td width="123">Staff Id:</td>
        <td width="357"><input type="text" name="id_staff" id="id_staff"></td>
      </tr>
      <tr>
        <td>Username:</td>
        <td>
          <input name="username" type="text" id="username" size="40">
        </td>
      </tr>
      <tr>
        <td>Password:</td>
        <td>
          <input type="password" name="password" id="password">
        </td>
      </tr>
      <tr>
        <td>Name:</td>
        <td>
          <input name="name" type="text" id="name" size="40">
        </td>
      </tr>
      <tr>
        <td>Age:</td>
        <td>
          <input name="age" type="text" id="age" size="8">
        </td>
      </tr>
      <tr>
        <td>Gender:</td>
        <td>
          <input type="radio" name="gender" id="gender" value="radio">
        Male
        <input type="radio" name="gender" id="gender" value="radio2">
        Female</td>
      </tr>
      <tr>
        <td>Birth of Date:</td>
        <td>
          <input type="text" name="birth" id="birth">
        (dd/mm/yyyy)</td>
      </tr>
      <tr>
        <td>Position:</td>
        <td>
          <input name="position" type="text" id="position" size="40">
        </td>
      </tr>
      <tr>
        <td>Department:</td>
        <td>
          <input name="dept" type="text" id="dept" size="40">
        </td>
      </tr>
      <tr>
        <td height="69">Address</td>
        <td>
          <textarea name="add" id="add" cols="45" rows="5"></textarea>
        </td>
      </tr>
      <tr>
        <td>Tel Office:</td>
        <td>
          <input type="text" name="tel_of" id="tel_of">
        </td>
      </tr>
      <tr>
        <td>Tel Hp:</td>
        <td>
          <input type="text" name="tel_hp" id="tel_hp">
        </td>
      </tr>
      <tr>
        <td>Email:</td>
        <td>
          <input name="email" type="text" id="email" size="40">
        </td>
      </tr>
      <tr>
        <td>Fax_num:</td>
        <td>
          <input type="text" name="fax_num" id="fax_num">
        </td>
      </tr>
      <tr>
        <td>Pic:</td>
        <td>
          <input type="file" name="pic" id="pic">
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>
          <input type="reset" name="Reset" id="button" value="Reset">
          <input type="submit" name="button2" id="button2" value="Submit">
        </td>
      </tr>
    </table>
    </form>

     </tr>
    </table></td>
          </tr>
        </table></td>
      </tr>
      <tr valign="middle">
        <td>&nbsp;</td>
      </tr>
    </table>

    Sponsored content

    Re: Pertolongan Ikhlas Ajar Bina Laman Web

    Post by Sponsored content Today at 9:56 am


      Current date/time is Fri Dec 09, 2016 9:56 am